summaryrefslogtreecommitdiffstats
path: root/tests/test_build_changes.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:25:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-15 17:25:40 +0000
commitcf7da1843c45a4c2df7a749f7886a2d2ba0ee92a (patch)
tree18dcde1a8d1f5570a77cd0c361de3b490d02c789 /tests/test_build_changes.py
parentInitial commit. (diff)
downloadsphinx-cf7da1843c45a4c2df7a749f7886a2d2ba0ee92a.tar.xz
sphinx-cf7da1843c45a4c2df7a749f7886a2d2ba0ee92a.zip
Adding upstream version 7.2.6.upstream/7.2.6
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/test_build_changes.py')
-rw-r--r--tests/test_build_changes.py34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests/test_build_changes.py b/tests/test_build_changes.py
new file mode 100644
index 0000000..b340c8d
--- /dev/null
+++ b/tests/test_build_changes.py
@@ -0,0 +1,34 @@
+"""Test the ChangesBuilder class."""
+
+import pytest
+
+
+@pytest.mark.sphinx('changes', testroot='changes')
+def test_build(app):
+ app.build()
+
+ # TODO: Use better checking of html content
+ htmltext = (app.outdir / 'changes.html').read_text(encoding='utf8')
+ assert 'New in version 0.6: Some funny stuff.' in htmltext
+ assert 'Changed in version 0.6: Even more funny stuff.' in htmltext
+ assert 'Deprecated since version 0.6: Boring stuff.' in htmltext
+
+ path_html = (
+ '<b>Path</b>: <i>deprecated:</i> Deprecated since version 0.6:'
+ ' So, that was a bad idea it turns out.')
+ assert path_html in htmltext
+
+ malloc_html = (
+ '<b>void *Test_Malloc(size_t n)</b>: <i>changed:</i> Changed in version 0.6:'
+ ' Can now be replaced with a different allocator.</a>')
+ assert malloc_html in htmltext
+
+
+@pytest.mark.sphinx(
+ 'changes', testroot='changes', srcdir='changes-none',
+ confoverrides={'version': '0.7', 'release': '0.7b1'})
+def test_no_changes(app, status):
+ app.build()
+
+ assert 'no changes in version 0.7.' in status.getvalue()
+ assert not (app.outdir / 'changes.html').exists()