blob: 5b16e74b82da53af9bb6a220bd9e8d2b9580b405 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
from pathlib import Path
from unittest import TestCase
from pyGHDL.dom.NonStandard import Design, Document
if __name__ == "__main__":
print("ERROR: you called a testcase declaration file as an executable module.")
print("Use: 'python -m unitest <testcase module>'")
exit(1)
class SimplePackage(TestCase):
_root = Path(__file__).resolve().parent.parent
_filename : Path = _root / "SimplePackage.vhdl"
def test_Package(self):
design = Design()
document = Document(self._filename)
design.Documents.append(document)
self.assertEqual(len(design.Documents[0].Packages), 1)
self.assertTrue(design.Documents[0].Packages[0].Name == "pack_1")
def test_PackageBody(self):
design = Design()
document = Document(self._filename)
design.Documents.append(document)
self.assertEqual(len(design.Documents[0].PackageBodies), 1)
self.assertTrue(design.Documents[0].PackageBodies[0].Name == "pack_1")
|