Skip to content

Commit cce298c

Browse files
committed
sdk test: use single .pdf test file
`test/adapter/aasx/TestFile.pdf` was replaced with file with actual content and used in new AASX tests. Old test were adapted to the new checksum.
1 parent c318a2b commit cce298c

4 files changed

Lines changed: 6 additions & 6 deletions

File tree

sdk/test/adapter/aasx/TestFile.pdf

594 KB
Binary file not shown.

sdk/test/adapter/aasx/test_aasx.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,14 +63,14 @@ def test_supplementary_file_container(self) -> None:
6363

6464
# Check metadata
6565
self.assertEqual("application/pdf", container.get_content_type("/TestFile.pdf"))
66-
self.assertEqual("b18229b24a4ee92c6c2b6bc6a8018563b17472f1150d35d5a5945afeb447ed44",
66+
self.assertEqual("142a0061de1ef5c22137ab05bb6001335596c0fc8693d33fa9b011ceac652342",
6767
container.get_sha256("/TestFile.pdf").hex())
6868
self.assertIn("/TestFile.pdf", container)
6969

7070
# Check contents
7171
file_content = io.BytesIO()
7272
container.write_file("/TestFile.pdf", file_content)
73-
self.assertEqual(hashlib.sha1(file_content.getvalue()).hexdigest(), "78450a66f59d74c073bf6858db340090ea72a8b1")
73+
self.assertEqual(hashlib.sha1(file_content.getvalue()).hexdigest(), "241e62aef8b4cdad0975f6c68a4ed8b3923d8db1")
7474

7575
# Add same file again with different content_type to test reference counting
7676
with open(__file__, 'rb') as f:
@@ -391,7 +391,7 @@ def test_writing_reading_example_aas(self) -> None:
391391
file_content = io.BytesIO()
392392
new_files.write_file("/TestFile.pdf", file_content)
393393
self.assertEqual(hashlib.sha1(file_content.getvalue()).hexdigest(),
394-
"78450a66f59d74c073bf6858db340090ea72a8b1")
394+
"241e62aef8b4cdad0975f6c68a4ed8b3923d8db1")
395395

396396
os.unlink(filename)
397397

@@ -534,7 +534,7 @@ def test_supplementary_file_integrity(self) -> None:
534534

535535
self.assertEqual(
536536
hashlib.sha1(buf.getvalue()).hexdigest(),
537-
"78450a66f59d74c073bf6858db340090ea72a8b1"
537+
"241e62aef8b4cdad0975f6c68a4ed8b3923d8db1"
538538
)
539539
finally:
540540
os.unlink(filename)

sdk/test/adapter/test.pdf

-602 KB
Binary file not shown.

sdk/test/adapter/test_load_directory.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ def test_reading_all_files(self):
3131
)
3232
)
3333

34-
# load test.pdf to save into aasx
34+
# load TestFile.pdf to save into aasx
3535
file_container = adapter.aasx.DictSupplementaryFileContainer()
36-
with open(Path(__file__).parent / "test.pdf", "rb") as pdf:
36+
with open(Path(__file__).parent / "aasx" / "TestFile.pdf", "rb") as pdf:
3737
resulting_file_name = file_container.add_file(
3838
"/aasx/suppl/file.pdf", pdf, "application/json")
3939

0 commit comments

Comments
 (0)