test: add test_module.py

This commit is contained in:
Xyphuz 2022-05-19 16:06:16 +08:00
parent 4ca486bc25
commit 77db4f578e
2 changed files with 11 additions and 1 deletions

5
tests/test_module.py Normal file
View file

@ -0,0 +1,5 @@
import os
def test_module():
assert os.system("python -m compose_viz") == 0

View file

@ -1551,4 +1551,9 @@ def test_parse_file(test_input: str, expected: Compose) -> None:
assert actual_service.volumes == expected_service.volumes
assert actual_service.depends_on == expected_service.depends_on
assert actual_service.links == expected_service.links
assert actual_service.extends == expected_service.extends
assert (actual_service.extends is not None) == (expected_service.extends is not None)
if (actual_service.extends is not None) and (expected_service.extends is not None):
assert actual_service.extends.service_name == expected_service.extends.service_name
assert actual_service.extends.from_file == expected_service.extends.from_file