1
0
mirror of https://github.com/certbot/certbot.git synced 2026-01-23 07:20:55 +03:00

Add NamespaceConfigTest.test_simple_http_port

This commit is contained in:
Jakub Warmuz
2015-10-04 10:32:29 +00:00
parent 560d12a40c
commit b4b7b020a2

View File

@@ -12,7 +12,7 @@ class NamespaceConfigTest(unittest.TestCase):
self.namespace = mock.MagicMock(
config_dir='/tmp/config', work_dir='/tmp/foo', foo='bar',
server='https://acme-server.org:443/new',
dvsni_port='1234', simple_http_port='4321')
dvsni_port='1234', simple_http_port=4321)
from letsencrypt.configuration import NamespaceConfig
self.config = NamespaceConfig(self.namespace)
@@ -47,6 +47,16 @@ class NamespaceConfigTest(unittest.TestCase):
self.assertEqual(self.config.key_dir, '/tmp/config/keys')
self.assertEqual(self.config.temp_checkpoint_dir, '/tmp/foo/t')
def test_simple_http_port(self):
self.assertEqual(4321, self.config.simple_http_port)
self.namespace.simple_http_port = None
self.namespace.no_simple_http_tls = True
self.assertEqual(80, self.config.simple_http_port)
self.namespace.no_simple_http_tls = False
self.assertEqual(443, self.config.simple_http_port)
class RenewerConfigurationTest(unittest.TestCase):
"""Test for letsencrypt.configuration.RenewerConfiguration."""