Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/certbot/certbot.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoona Hoikkala <joona@kuori.org>2015-12-07 14:16:48 +0300
committerJoona Hoikkala <joona@kuori.org>2015-12-07 14:16:48 +0300
commit718a6481f1c2f72139d78ec5fa63a1c817f52bb7 (patch)
tree27148ed19ba7e21568c765592c4848c07ba11190 /letsencrypt-apache
parent43473827802a2756dadcce2ce15228db5e876c48 (diff)
Tests for the lone function in constants
Diffstat (limited to 'letsencrypt-apache')
-rw-r--r--letsencrypt-apache/letsencrypt_apache/tests/constants_test.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/letsencrypt-apache/letsencrypt_apache/tests/constants_test.py b/letsencrypt-apache/letsencrypt_apache/tests/constants_test.py
new file mode 100644
index 000000000..478debb59
--- /dev/null
+++ b/letsencrypt-apache/letsencrypt_apache/tests/constants_test.py
@@ -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")