diff --git a/tests/test_parse_file.py b/tests/test_parse_file.py index 1eaa166..54a8c86 100644 --- a/tests/test_parse_file.py +++ b/tests/test_parse_file.py @@ -265,7 +265,86 @@ from compose_viz.parser import Parser ], ), ), - + ( + "env_file/docker-compose", + Compose( + services=[ + Service( + name="frontend", + image="awesome/frontend", + env_file=[ + "a.env" + ], + ), + Service( + name="backend", + image="awesome/backend", + env_file=[ + "b.env" + ], + ), + Service( + name="db", + image="awesome/db", + env_file=[ + "c.env", + "d.env" + ], + ), + ], + ), + ), + ( + "expose/docker-compose", + Compose( + services=[ + Service( + name="frontend", + image="awesome/frontend", + expose=[ + "27118" + ], + ), + Service( + name="backend", + image="awesome/backend", + expose=[ + "27017", + "27018" + ], + ), + ], + ), + ), + ( + "profiles/docker-compose", + Compose( + services=[ + Service( + name="frontend", + image="awesome/frontend", + profiles=[ + "frontend" + ], + ), + Service( + name="phpmyadmin", + image="phpmyadmin", + profiles=[ + "debug" + ], + ), + Service( + name="db", + image="awesome/db", + profiles=[ + "db", + "sql" + ], + ), + ], + ), + ), ], ) def test_parse_file(test_file_path: str, expected: Compose) -> None: @@ -305,3 +384,6 @@ def test_parse_file(test_file_path: str, expected: Compose) -> None: assert actual_service.cgroup_parent == expected_service.cgroup_parent assert actual_service.container_name == expected_service.container_name + assert actual_service.expose == expected_service.expose + assert actual_service.env_file == expected_service.env_file + assert actual_service.profiles == expected_service.profiles \ No newline at end of file