summaryrefslogtreecommitdiff
path: root/tests/test_application.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2016-01-01 12:06:46 +0900
committerTakeshi KOMIYA <i.tkomiya@gmail.com>2016-01-04 10:23:17 +0900
commitf81ab1e8b9690902721901eda378a47d7dc6e8a0 (patch)
tree6d9139f228d651cb0900d420cd07a35e57eaed00 /tests/test_application.py
parentddf6acd33c31af56738566363efc0ac21396a1fe (diff)
downloadsphinx-git-f81ab1e8b9690902721901eda378a47d7dc6e8a0.tar.gz
Fix #2162: Add Sphinx.add_source_parser() to add source_suffix and source_parsers from extension
Diffstat (limited to 'tests/test_application.py')
-rw-r--r--tests/test_application.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/test_application.py b/tests/test_application.py
index c878cc1b6..a19664bf7 100644
--- a/tests/test_application.py
+++ b/tests/test_application.py
@@ -88,3 +88,18 @@ def test_domain_override(app, status, warning):
assert app.override_domain(B) is None
raises_msg(ExtensionError, 'new domain not a subclass of registered '
'foo domain', app.override_domain, C)
+
+
+@with_app(testroot='add_source_parser')
+def test_add_source_parser(app, status, warning):
+ assert set(app.config.source_suffix) == set(['.rst', '.md', '.test'])
+ assert set(app.config.source_parsers.keys()) == set(['.md', '.test'])
+ assert app.config.source_parsers['.md'].__name__ == 'DummyMarkdownParser'
+ assert app.config.source_parsers['.test'].__name__ == 'TestSourceParser'
+
+
+@with_app(testroot='add_source_parser-conflicts-with-users-setting')
+def test_add_source_parser_conflicts_with_users_setting(app, status, warning):
+ assert set(app.config.source_suffix) == set(['.rst', '.test'])
+ assert set(app.config.source_parsers.keys()) == set(['.test'])
+ assert app.config.source_parsers['.test'].__name__ == 'DummyTestParser'