diff options
Diffstat (limited to 'tests/test_domain_py.py')
-rw-r--r-- | tests/test_domain_py.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/test_domain_py.py b/tests/test_domain_py.py index afc34a697..e7ff407bd 100644 --- a/tests/test_domain_py.py +++ b/tests/test_domain_py.py @@ -292,6 +292,29 @@ def test_pyobject_prefix(app): assert doctree[1][1][3].astext().strip() == 'FooBar.say' # not stripped +def test_pydata(app): + text = ".. py:data:: var\n" + domain = app.env.get_domain('py') + doctree = restructuredtext.parse(app, text) + assert_node(doctree, (addnodes.index, + [desc, ([desc_signature, desc_name, "var"], + [desc_content, ()])])) + assert 'var' in domain.objects + assert domain.objects['var'] == ('index', 'data') + + +def test_pyfunction(app): + text = ".. py:function:: func\n" + domain = app.env.get_domain('py') + doctree = restructuredtext.parse(app, text) + assert_node(doctree, (addnodes.index, + [desc, ([desc_signature, ([desc_name, "func"], + [desc_parameterlist, ()])], + [desc_content, ()])])) + assert 'func' in domain.objects + assert domain.objects['func'] == ('index', 'function') + + def test_pymethod(app): text = (".. py:class:: Class\n" "\n" |