chore: create env, expose, profiles test case
This commit is contained in:
parent
f6615ca1b9
commit
50589db102
1 changed files with 83 additions and 1 deletions
|
@ -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
|
Loading…
Reference in a new issue