diff --git a/oglio/OglVersion.py b/oglio/OglVersion.py new file mode 100644 index 0000000..7311627 --- /dev/null +++ b/oglio/OglVersion.py @@ -0,0 +1,5 @@ + +# +# This is the version of the XML that we currently support +# +version: str ='10' \ No newline at end of file diff --git a/oglio/Reader.py b/oglio/Reader.py index 4fd2aeb..247e5da 100644 --- a/oglio/Reader.py +++ b/oglio/Reader.py @@ -10,6 +10,7 @@ from untanglepyut.UnTangler import Documents from untanglepyut.UnTangler import UnTangler +from oglio import OglVersion from oglio.Types import OglActors from oglio.Types import OglClasses from oglio.Types import OglDocument @@ -110,6 +111,7 @@ def _makeOglProject(self, untangler: UnTangler) -> OglProject: oglProject.toOglProject(untangler.projectInformation) + assert oglProject.version == OglVersion.version, 'We have mismatched XML versions' documents: Documents = untangler.documents for document in documents.values(): self.logger.debug(f'Untangled - {document.documentTitle}') diff --git a/setup.py b/setup.py index 03acca9..833f3d9 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ setup( name="oglio", - version="0.5.60", + version="0.5.62", author_email='Humberto.A.Sanchez.II@gmail.com', maintainer='Humberto A. Sanchez II', maintainer_email='humberto.a.sanchez.ii@gmail.com', diff --git a/tests/oglio/TestReader.py b/tests/oglio/TestReader.py index 5efe9c7..37e901d 100644 --- a/tests/oglio/TestReader.py +++ b/tests/oglio/TestReader.py @@ -9,6 +9,7 @@ from pkg_resources import resource_filename +from oglio import OglVersion from oglio.Reader import Reader from oglio.Types import OglClasses @@ -50,6 +51,9 @@ def testProjectInformation(self): oglProject: OglProject = self._reader.readXmlFile(fqFileName=fqFileName) self.assertEqual(fqFileName, oglProject.fileName, 'Where is my file name') + expectedVersion: str = OglVersion.version + actualVersion: str = oglProject.version + self.assertEqual(expectedVersion, actualVersion, 'Mismatch in support Ogl Xml versions') def testMultiDocumentRead(self):