diff options
| author | Franck Michea <franck.michea@gmail.com> | 2012-10-11 20:58:54 +0200 |
|---|---|---|
| committer | Franck Michea <franck.michea@gmail.com> | 2012-10-11 20:58:54 +0200 |
| commit | 45e309a56003ac5a90624edb99ed273deec5be00 (patch) | |
| tree | bc490e851fb38544dfed5a043695d5ecd5eb3b76 /tests/test_application.py | |
| parent | 9ee282995b60455905bf2eefd6fd88f5d1969dab (diff) | |
| download | sphinx-45e309a56003ac5a90624edb99ed273deec5be00.tar.gz | |
domain override: fix issue #1009.
Diffstat (limited to 'tests/test_application.py')
| -rw-r--r-- | tests/test_application.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/test_application.py b/tests/test_application.py index 4baabcec..a6e798c2 100644 --- a/tests/test_application.py +++ b/tests/test_application.py @@ -12,6 +12,7 @@ from StringIO import StringIO from sphinx.application import ExtensionError +from sphinx.domains import Domain from util import * @@ -69,3 +70,23 @@ def test_extensions(): assert warnings.getvalue().startswith("WARNING: extension 'shutil'") finally: app.cleanup() + +def test_domain_override(): + class A(Domain): + name = 'foo' + class B(A): + name = 'foo' + class C(Domain): + name = 'foo' + status, warnings = StringIO(), StringIO() + app = TestApp(status=status, warning=warnings) + try: + # No domain know named foo. + raises_msg(ExtensionError, 'domain foo not yet registered', + app.override_domain, A) + assert app.add_domain(A) is None + assert app.override_domain(B) is None + raises_msg(ExtensionError, 'new domain not a subclass of registered ' + 'foo domain', app.override_domain, C) + finally: + app.cleanup() |
