test: use a better way to make assertion

This commit is contained in:
Xyphuz 2022-05-15 02:42:27 +08:00
parent a4520ff134
commit 7f59cebb85

View file

@ -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