mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Merge pull request #7262 from tk0miya/testcase_for_py
test: Add testcase for special case of PythonDomain.find_obj()
This commit is contained in:
commit
372813a137
@ -51,3 +51,11 @@ module
|
|||||||
.. py:attribute:: attr2
|
.. py:attribute:: attr2
|
||||||
|
|
||||||
:type: :doc:`index`
|
:type: :doc:`index`
|
||||||
|
|
||||||
|
.. py:module:: exceptions
|
||||||
|
|
||||||
|
.. py:exception:: Exception
|
||||||
|
|
||||||
|
.. py:module:: object
|
||||||
|
|
||||||
|
.. py:function:: sum()
|
||||||
|
@ -206,6 +206,18 @@ def test_domain_py_find_obj(app, status, warning):
|
|||||||
[('NestedParentA.NestedChildA.subchild_1',
|
[('NestedParentA.NestedChildA.subchild_1',
|
||||||
('roles', 'nestedparenta-nestedchilda-subchild-1', 'method'))])
|
('roles', 'nestedparenta-nestedchilda-subchild-1', 'method'))])
|
||||||
|
|
||||||
|
# special case: exceptions
|
||||||
|
assert (find_obj('exceptions', None, 'Exception', 'exc') ==
|
||||||
|
[('exceptions.Exception', ('module', 'exceptions-exception', 'exception'))])
|
||||||
|
assert (find_obj(None, None, 'Exception', 'exc') ==
|
||||||
|
[('exceptions.Exception', ('module', 'exceptions-exception', 'exception'))])
|
||||||
|
|
||||||
|
# special case: object
|
||||||
|
assert (find_obj('object', None, 'sum', 'func') ==
|
||||||
|
[('object.sum', ('module', 'object-sum', 'function'))])
|
||||||
|
assert (find_obj(None, None, 'sum', 'func') ==
|
||||||
|
[('object.sum', ('module', 'object-sum', 'function'))])
|
||||||
|
|
||||||
|
|
||||||
def test_get_full_qualified_name():
|
def test_get_full_qualified_name():
|
||||||
env = Mock(domaindata={})
|
env = Mock(domaindata={})
|
||||||
|
Loading…
Reference in New Issue
Block a user