Skip to content

Commit

Permalink
Add test for document version consistency
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Dialpuri committed Aug 3, 2024
1 parent 072da7e commit da02f29
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions package/tests/test_docs.py
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit da02f29

Please sign in to comment.