From da02f29b461477a4309a0f268ed78ebf5b6e5a63 Mon Sep 17 00:00:00 2001 From: Jordan Dialpuri <44945647+Dialpuri@users.noreply.github.com> Date: Sat, 3 Aug 2024 10:57:52 +0100 Subject: [PATCH] Add test for document version consistency Create a test to ensure the version in writerside.cfg matches the sails package version. This includes parsing the XML configuration and comparing the version number. --- package/tests/test_docs.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 package/tests/test_docs.py diff --git a/package/tests/test_docs.py b/package/tests/test_docs.py new file mode 100644 index 0000000..d748076 --- /dev/null +++ b/package/tests/test_docs.py @@ -0,0 +1,16 @@ +import xml.etree.ElementTree as ET +from pathlib import Path +import sails + + +def test_doc_version(): + current_file = Path(__file__) + base_dir = current_file.parents[2] + doc_path = base_dir / "docs" / "Writerside" / "writerside.cfg" + + assert doc_path.exists() + xml = ET.parse(str(doc_path)) + root = xml.getroot() + x = root.find('instance') + doc_version = x.attrib['version'] + assert sails.__version__ == doc_version \ No newline at end of file