From 77db4f578e6a2f0d10afa0651a003cbd063a5d6a Mon Sep 17 00:00:00 2001 From: Xyphuz Date: Thu, 19 May 2022 16:06:16 +0800 Subject: [PATCH] test: add test_module.py --- tests/test_module.py | 5 +++++ tests/test_parse_file.py | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) create mode 100644 tests/test_module.py diff --git a/tests/test_module.py b/tests/test_module.py new file mode 100644 index 0000000..136b7a9 --- /dev/null +++ b/tests/test_module.py @@ -0,0 +1,5 @@ +import os + + +def test_module(): + assert os.system("python -m compose_viz") == 0 diff --git a/tests/test_parse_file.py b/tests/test_parse_file.py index f91249d..56f8b21 100644 --- a/tests/test_parse_file.py +++ b/tests/test_parse_file.py @@ -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