summaryrefslogtreecommitdiffstats
path: root/tests/roots/test-domain-py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/roots/test-domain-py')
-rw-r--r--tests/roots/test-domain-py/abbr.rst10
-rw-r--r--tests/roots/test-domain-py/canonical.rst12
-rw-r--r--tests/roots/test-domain-py/conf.py1
-rw-r--r--tests/roots/test-domain-py/index.rst10
-rw-r--r--tests/roots/test-domain-py/module.rst60
-rw-r--r--tests/roots/test-domain-py/module_option.rst25
-rw-r--r--tests/roots/test-domain-py/roles.rst48
7 files changed, 166 insertions, 0 deletions
diff --git a/tests/roots/test-domain-py/abbr.rst b/tests/roots/test-domain-py/abbr.rst
new file mode 100644
index 0000000..67f1157
--- /dev/null
+++ b/tests/roots/test-domain-py/abbr.rst
@@ -0,0 +1,10 @@
+abbrev
+======
+
+.. currentmodule:: module_a.submodule
+
+* normal: :py:meth:`module_a.submodule.ModTopLevel.mod_child_1`
+* relative: :py:meth:`.ModTopLevel.mod_child_1`
+* short name: :py:meth:`~module_a.submodule.ModTopLevel.mod_child_1`
+* relative + short name: :py:meth:`~.ModTopLevel.mod_child_1`
+* short name + relative: :py:meth:`~.ModTopLevel.mod_child_1`
diff --git a/tests/roots/test-domain-py/canonical.rst b/tests/roots/test-domain-py/canonical.rst
new file mode 100644
index 0000000..34becfd
--- /dev/null
+++ b/tests/roots/test-domain-py/canonical.rst
@@ -0,0 +1,12 @@
+caninical
+=========
+
+:py:class:`.Foo`
+:any:`Foo`
+:any:`module.Foo`
+:any:`original.module.Foo`
+
+.. py:module:: canonical
+
+.. py:class:: Foo
+ :canonical: original.module.Foo
diff --git a/tests/roots/test-domain-py/conf.py b/tests/roots/test-domain-py/conf.py
new file mode 100644
index 0000000..a45d22e
--- /dev/null
+++ b/tests/roots/test-domain-py/conf.py
@@ -0,0 +1 @@
+exclude_patterns = ['_build']
diff --git a/tests/roots/test-domain-py/index.rst b/tests/roots/test-domain-py/index.rst
new file mode 100644
index 0000000..b24bbea
--- /dev/null
+++ b/tests/roots/test-domain-py/index.rst
@@ -0,0 +1,10 @@
+test-domain-py
+==============
+
+.. toctree::
+
+ roles
+ module
+ module_option
+ abbr
+ canonical
diff --git a/tests/roots/test-domain-py/module.rst b/tests/roots/test-domain-py/module.rst
new file mode 100644
index 0000000..4a28068
--- /dev/null
+++ b/tests/roots/test-domain-py/module.rst
@@ -0,0 +1,60 @@
+module
+======
+
+.. py:module:: module_a.submodule
+
+* Link to :py:class:`ModTopLevel`
+
+.. py:class:: ModTopLevel
+
+ * Link to :py:meth:`mod_child_1`
+ * Link to :py:meth:`ModTopLevel.mod_child_1`
+
+.. py:method:: ModTopLevel.mod_child_1
+
+ * Link to :py:meth:`mod_child_2`
+
+.. py:method:: ModTopLevel.mod_child_2
+
+ * Link to :py:meth:`module_a.submodule.ModTopLevel.mod_child_1`
+
+.. py:property:: ModTopLevel.prop
+
+ * Link to :py:attr:`prop attribute <.prop>`
+ * Link to :py:meth:`prop method <.prop>`
+
+.. py:currentmodule:: None
+
+.. py:class:: ModNoModule
+
+.. py:module:: module_b.submodule
+
+* Link to :py:class:`ModTopLevel`
+
+.. py:class:: ModTopLevel
+
+ * Link to :py:class:`ModNoModule`
+
+.. py:function:: foo(x, y)
+
+ :param x: param x
+ :type x: int
+ :param y: param y
+ :type y: tuple(str, float)
+ :rtype: list
+
+.. py:attribute:: attr1
+
+ :type: ModTopLevel
+
+.. py:attribute:: attr2
+
+ :type: :doc:`index`
+
+.. py:module:: exceptions
+
+.. py:exception:: Exception
+
+.. py:module:: object
+
+.. py:function:: sum()
diff --git a/tests/roots/test-domain-py/module_option.rst b/tests/roots/test-domain-py/module_option.rst
new file mode 100644
index 0000000..1dec2ce
--- /dev/null
+++ b/tests/roots/test-domain-py/module_option.rst
@@ -0,0 +1,25 @@
+module_option
+=============
+
+.. py:class:: B
+ :module: test.extra
+
+ This is also a test.
+
+
+ .. py:method:: B.baz()
+ :module: test.extra
+
+ Does something similar to :meth:`foo`.
+
+
+ .. py:method:: B.foo()
+ :module: test.extra
+
+ Does something.
+
+
+ .. py:method:: B.test()
+ :module: test.extra
+
+ Does something completely unrelated to :meth:`foo`
diff --git a/tests/roots/test-domain-py/roles.rst b/tests/roots/test-domain-py/roles.rst
new file mode 100644
index 0000000..6bff2d2
--- /dev/null
+++ b/tests/roots/test-domain-py/roles.rst
@@ -0,0 +1,48 @@
+roles
+=====
+
+.. py:class:: TopLevel
+
+.. py:method:: top_level
+
+* :py:class:`TopLevel`
+* :py:meth:`top_level`
+
+
+.. py:class:: NestedParentA
+
+ * Link to :py:meth:`child_1`
+
+ .. py:method:: child_1()
+
+ * Link to :py:meth:`NestedChildA.subchild_2`
+ * Link to :py:meth:`child_2`
+ * Link to :any:`any_child`
+
+ .. py:method:: any_child()
+
+ * Link to :py:class:`NestedChildA`
+
+ .. py:class:: NestedChildA
+
+ .. py:method:: subchild_1()
+
+ * Link to :py:meth:`subchild_2`
+
+ .. py:method:: subchild_2()
+
+ Link to :py:meth:`NestedParentA.child_1`
+
+ .. py:method:: child_2()
+
+ Link to :py:meth:`NestedChildA.subchild_1`
+
+.. py:class:: NestedParentB
+
+ * Link to :py:meth:`child_1`
+
+ .. py:method:: child_1()
+
+ * Link to :py:class:`NestedParentB`
+
+* :py:class:`NestedParentA.NestedChildA`