diff options
author | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-04-23 01:02:29 +0900 |
---|---|---|
committer | Takeshi KOMIYA <i.tkomiya@gmail.com> | 2017-04-23 16:31:33 +0900 |
commit | 96fa6d2972ea7c77525607ec490daed9e303535d (patch) | |
tree | 610c22b6788db2b6c5449cf4819fa5ac190e30d6 /tests/test_ext_intersphinx.py | |
parent | db377ceb5524ec276ac6d18ed3206b8147800ae7 (diff) | |
download | sphinx-git-96fa6d2972ea7c77525607ec490daed9e303535d.tar.gz |
Implement get_full_qualified_name() to JavascriptDomain (refs: #3630)
Diffstat (limited to 'tests/test_ext_intersphinx.py')
-rw-r--r-- | tests/test_ext_intersphinx.py | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/test_ext_intersphinx.py b/tests/test_ext_intersphinx.py index 0fa6c93b7..4774604e8 100644 --- a/tests/test_ext_intersphinx.py +++ b/tests/test_ext_intersphinx.py @@ -212,6 +212,30 @@ def test_missing_reference_stddomain(tempdir, app, status, warning): assert rn.astext() == 'ls -l' +def test_missing_reference_jsdomain(tempdir, app, status, warning): + inv_file = tempdir / 'inventory' + inv_file.write_bytes(inventory_v2) + app.config.intersphinx_mapping = { + 'https://docs.python.org/': inv_file, + } + app.config.intersphinx_cache_limit = 0 + + # load the inventory and check if it's done correctly + load_mappings(app) + + # no context data + kwargs = {} + node, contnode = fake_node('js', 'meth', 'baz', 'baz()', **kwargs) + rn = missing_reference(app, app.env, node, contnode) + assert rn is None + + # js:module and js:object context helps to search objects + kwargs = {'js:module': 'foo', 'js:object': 'bar'} + node, contnode = fake_node('js', 'meth', 'baz', 'baz()', **kwargs) + rn = missing_reference(app, app.env, node, contnode) + assert rn.astext() == 'baz()' + + def test_load_mappings_warnings(tempdir, app, status, warning): """ load_mappings issues a warning if new-style mapping |