diff options
author | Joona Hoikkala <joona@kuori.org> | 2015-12-07 14:16:48 +0300 |
---|---|---|
committer | Joona Hoikkala <joona@kuori.org> | 2015-12-07 14:16:48 +0300 |
commit | 718a6481f1c2f72139d78ec5fa63a1c817f52bb7 (patch) | |
tree | 27148ed19ba7e21568c765592c4848c07ba11190 /letsencrypt-apache | |
parent | 43473827802a2756dadcce2ce15228db5e876c48 (diff) |
Tests for the lone function in constants
Diffstat (limited to 'letsencrypt-apache')
-rw-r--r-- | letsencrypt-apache/letsencrypt_apache/tests/constants_test.py | 22 |
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") |