diff options
| author | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2003-09-12 22:24:49 +0000 |
|---|---|---|
| committer | goodger <goodger@929543f6-e4f2-0310-98a6-ba3bd3dd1d04> | 2003-09-12 22:24:49 +0000 |
| commit | 83c14aa826f4876582fc69c17b96034ea5bef42d (patch) | |
| tree | 13067b70084fba8a6ce76f6a4772e6bd068bb834 /docutils/test | |
| parent | b07b47a01b7480d77afd6c3713c8cda09a8f9922 (diff) | |
| download | docutils-83c14aa826f4876582fc69c17b96034ea5bef42d.tar.gz | |
improved setting handling
git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@1682 929543f6-e4f2-0310-98a6-ba3bd3dd1d04
Diffstat (limited to 'docutils/test')
| -rw-r--r-- | docutils/test/data/config_list_2.txt | 2 | ||||
| -rwxr-xr-x | docutils/test/test_settings.py | 15 |
2 files changed, 13 insertions, 4 deletions
diff --git a/docutils/test/data/config_list_2.txt b/docutils/test/data/config_list_2.txt new file mode 100644 index 000000000..6f8d69f07 --- /dev/null +++ b/docutils/test/data/config_list_2.txt @@ -0,0 +1,2 @@ +[general] +expose_internals: f diff --git a/docutils/test/test_settings.py b/docutils/test/test_settings.py index d22d10fbc..7357c6463 100755 --- a/docutils/test/test_settings.py +++ b/docutils/test/test_settings.py @@ -36,6 +36,7 @@ class ConfigFileTests(unittest.TestCase): 'one': fixpath('data/config_1.txt'), 'two': fixpath('data/config_2.txt'), 'list': fixpath('data/config_list.txt'), + 'list2': fixpath('data/config_list_2.txt'), 'error': fixpath('data/config_error_handler.txt')} settings = { @@ -56,6 +57,7 @@ class ConfigFileTests(unittest.TestCase): 'two': {'generator': 0, 'stylesheet_path': fixpath('data/test.css')}, 'list': {'expose_internals': ['a', 'b', 'c', 'd', 'e']}, + 'list2': {'expose_internals': ['a', 'b', 'c', 'd', 'e', 'f']}, 'error': {'error_encoding': 'ascii', 'error_encoding_error_handler': 'strict'}, } @@ -68,11 +70,11 @@ class ConfigFileTests(unittest.TestCase): components=(pep_html.Writer,), read_config_files=None) def files_settings(self, *names): - settings = {} + settings = frontend.Values() for name in names: settings.update(self.option_parser.get_config_file_settings( - self.config_files[name])) - return settings + self.config_files[name]), self.option_parser) + return settings.__dict__ def expected_settings(self, *names): expected = {} @@ -117,6 +119,10 @@ class ConfigFileTests(unittest.TestCase): self.compare_output(self.files_settings('list'), self.expected_settings('list')) + def test_list2(self): + self.compare_output(self.files_settings('list', 'list2'), + self.expected_settings('list2')) + def test_error_handler(self): self.compare_output(self.files_settings('error'), self.expected_settings('error')) @@ -137,7 +143,8 @@ class ConfigEnvVarFileTests(ConfigFileTests): def files_settings(self, *names): files = [self.config_files[name] for name in names] os.environ['DOCUTILSCONFIG'] = os.pathsep.join(files) - return self.option_parser.get_standard_config_settings() + settings = self.option_parser.get_standard_config_settings() + return settings.__dict__ def tearDown(self): os.environ = self.orig_environ |
