mirror of
https://github.com/certbot/certbot.git
synced 2026-07-28 00:35:50 +02:00
Update Configuration test
This commit is contained in:
@@ -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__':
|
||||
|
||||
Reference in New Issue
Block a user