diff options
Diffstat (limited to 'testsuite/pyunit')
-rw-r--r-- | testsuite/pyunit/dom/SimpleEntity.py | 28 | ||||
-rw-r--r-- | testsuite/pyunit/libghdl/Initialize.py | 2 |
2 files changed, 22 insertions, 8 deletions
diff --git a/testsuite/pyunit/dom/SimpleEntity.py b/testsuite/pyunit/dom/SimpleEntity.py index 429c1a5a8..046d5ceff 100644 --- a/testsuite/pyunit/dom/SimpleEntity.py +++ b/testsuite/pyunit/dom/SimpleEntity.py @@ -1,7 +1,8 @@ from pathlib import Path from unittest import TestCase -from pyVHDLModel.VHDLModel import Design, Library, Document, Entity +from pyGHDL.dom.Misc import Design, Library, Document +from pyGHDL.dom.DesignUnit import Entity, Architecture if __name__ == "__main__": @@ -10,16 +11,29 @@ if __name__ == "__main__": exit(1) -class Instantiate(TestCase): +class SimpleEntity(TestCase): + _path: Path = Path("testsuite/pyunit/SimpleEntity.vhdl") + def test_Design(self): design = Design() - def test_Library(self): - library = Library() + self.assertIsNotNone(design) + + # def test_Library(self): + # library = Library() def test_Document(self): - path = Path("tests.vhdl") - document = Document(path) + design = Design() + document = Document(self._path) + design.Documents.append(document) + + self.assertTrue(len(design.Documents) == 1) def test_Entity(self): - entity = Entity("entity_1") + design = Design() + document = Document(self._path) + design.Documents.append(document) + + self.assertEqual(len(design.Documents[0].Entities), 1) + self.assertTrue(design.Documents[0].Entities[0].Name == "e1") + diff --git a/testsuite/pyunit/libghdl/Initialize.py b/testsuite/pyunit/libghdl/Initialize.py index 1db2eed18..8bbc0e954 100644 --- a/testsuite/pyunit/libghdl/Initialize.py +++ b/testsuite/pyunit/libghdl/Initialize.py @@ -16,7 +16,7 @@ if __name__ == "__main__": class Instantiate(TestCase): - _filename : Path = Path("testsuite/pyunit/libghdl/simpleEntity.vhdl") + _filename : Path = Path("testsuite/pyunit/SimpleEntity.vhdl") @staticmethod def getIdentifier(node): |