diff --git a/letsencrypt/client/tests/configuration_test.py b/letsencrypt/client/tests/configuration_test.py index 537e26b91..cbbcd57ba 100644 --- a/letsencrypt/client/tests/configuration_test.py +++ b/letsencrypt/client/tests/configuration_test.py @@ -1,4 +1,5 @@ """Tests for letsencrypt.client.configuration.""" +import os import unittest import mock @@ -18,6 +19,14 @@ class NamespaceConfigTest(unittest.TestCase): self.assertEqual(self.config.foo, 'bar') self.assertEqual(self.config.work_dir, '/tmp/foo') + def test_server_path(self): + self.assertEqual(['acme-server.org:443', 'new'], + self.config.server_path.split(os.path.sep)) + + def test_server_url(self): + self.assertEqual( + self.config.server_url, 'https://acme-server.org:443/new') + @mock.patch('letsencrypt.client.configuration.constants') def test_dynamic_dirs(self, constants): constants.TEMP_CHECKPOINT_DIR = 't' @@ -30,13 +39,13 @@ class NamespaceConfigTest(unittest.TestCase): self.assertEqual(self.config.temp_checkpoint_dir, '/tmp/foo/t') self.assertEqual(self.config.in_progress_dir, '/tmp/foo/../p') self.assertEqual( - self.config.cert_key_backup, '/tmp/foo/c/acme-server.org') + self.config.cert_key_backup, '/tmp/foo/c/acme-server.org:443/new') self.assertEqual(self.config.rec_token_dir, '/r') self.assertEqual( - self.config.accounts_dir, '/tmp/config/acc/acme-server.org-443-new') + self.config.accounts_dir, '/tmp/config/acc/acme-server.org:443/new') self.assertEqual( self.config.account_keys_dir, - '/tmp/config/acc/acme-server.org-443-new/keys') + '/tmp/config/acc/acme-server.org:443/new/keys') if __name__ == '__main__':