mirror of
https://github.com/certbot/certbot.git
synced 2026-07-29 17:37:05 +02:00
Tests for the lone function in constants
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import mock
|
||||
import unittest
|
||||
|
||||
from letsencrypt_apache import constants
|
||||
|
||||
|
||||
class ConstantsTest(unittest.TestCase):
|
||||
|
||||
@mock.patch("letsencrypt.le_util.get_os_info")
|
||||
def test_get_debian_value(self, os_info):
|
||||
os_info.return_value = ('Debian','','')
|
||||
self.assertEqual(constants.os_constant("ctl"), "apache2ctl")
|
||||
|
||||
@mock.patch("letsencrypt.le_util.get_os_info")
|
||||
def test_get_centos_value(self, os_info):
|
||||
os_info.return_value = ('CentOS Linux','','')
|
||||
self.assertEqual(constants.os_constant("ctl"), "apachectl")
|
||||
|
||||
@mock.patch("letsencrypt.le_util.get_os_info")
|
||||
def test_get_default_value(self, os_info):
|
||||
os_info.return_value = ('Nonexistent Linux','','')
|
||||
self.assertEqual(constants.os_constant("ctl"), "apache2ctl")
|
||||
Reference in New Issue
Block a user