Skip to content

Commit

Permalink
WIP test
Browse files Browse the repository at this point in the history
Signed-off-by: nstarman <[email protected]>
  • Loading branch information
nstarman committed Feb 22, 2024
1 parent 8705d7a commit e02d4ee
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions sphinx_automodapi/tests/test_automodsumm.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,39 @@ def test_ams_cython(tmpdir, cython_testpackage): # noqa
result = f.read()

assert result == ams_cython_expected


# =============================================================================

sorted_str = """
Before
.. automodsumm:: sphinx_automodapi.tests.example_module.classes
:sort:
And After
"""

sorted_expected = """\
.. currentmodule:: sphinx_automodapi.tests.example_module.classes
.. autosummary::
Egg
Spam
"""


def test_sort(tmpdir):
with open(tmpdir.join("index.rst").strpath, "w") as f:
f.write(sorted_str)

write_api_files_to_tmpdir(tmpdir)

run_sphinx_in_tmpdir(tmpdir)

with open(tmpdir.join("index.rst.automodsumm").strpath) as f:
result = f.read()

assert result == sorted_expected

0 comments on commit e02d4ee

Please sign in to comment.