From 7f59cebb859cc3758d1f47390f7f9dbe6cf78045 Mon Sep 17 00:00:00 2001 From: Xyphuz Date: Sun, 15 May 2022 02:42:27 +0800 Subject: [PATCH] test: use a better way to make assertion --- tests/test_parse_file.py | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/tests/test_parse_file.py b/tests/test_parse_file.py index bfc6b4a..c66e336 100644 --- a/tests/test_parse_file.py +++ b/tests/test_parse_file.py @@ -25,4 +25,14 @@ def test_parse_file(): parser = Parser() actual = parser.parse('tests/in/000001.yaml') - assert actual == expected + assert len(actual.services) == len(expected.services) + + for actual_service, expected_service in zip(actual.services, expected.services): + assert actual_service.name == expected_service.name + assert actual_service.image == expected_service.image + assert actual_service.ports == expected_service.ports + assert actual_service.networks == expected_service.networks + 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