Skip to content

Commit

Permalink
chore(up): cleaning up tests (#196)
Browse files Browse the repository at this point in the history
  • Loading branch information
IanWoodard authored Jan 6, 2025
1 parent 83e6330 commit 4be853f
Showing 1 changed file with 124 additions and 0 deletions.
124 changes: 124 additions & 0 deletions tests/commands/test_up.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,37 @@ def test_up_simple(

mock_create_devservices_network.assert_called_once()

mock_subprocess_check_output.assert_has_calls(
[
mock.call(
[
"docker",
"compose",
"-f",
f"{service_path}/{DEVSERVICES_DIR_NAME}/{CONFIG_FILE_NAME}",
"config",
"--services",
],
text=True,
env=mock.ANY,
),
mock.call(
[
"docker",
"compose",
"-p",
"example-service",
"-f",
f"{service_path}/{DEVSERVICES_DIR_NAME}/{CONFIG_FILE_NAME}",
"ps",
"--format",
"{{.Name}}",
],
text=True,
),
]
)

mock_run.assert_called_with(
[
"docker",
Expand Down Expand Up @@ -346,6 +377,37 @@ def test_up_docker_compose_container_lookup_error(

mock_create_devservices_network.assert_called_once()

mock_subprocess_check_output.assert_has_calls(
[
mock.call(
[
"docker",
"compose",
"-f",
f"{service_path}/{DEVSERVICES_DIR_NAME}/{CONFIG_FILE_NAME}",
"config",
"--services",
],
text=True,
env=mock.ANY,
),
mock.call(
[
"docker",
"compose",
"-p",
"example-service",
"-f",
f"{service_path}/{DEVSERVICES_DIR_NAME}/{CONFIG_FILE_NAME}",
"ps",
"--format",
"{{.Name}}",
],
text=True,
),
]
)

mock_run.assert_called_with(
[
"docker",
Expand Down Expand Up @@ -451,6 +513,37 @@ def test_up_docker_compose_container_healthcheck_failed(

mock_create_devservices_network.assert_called_once()

mock_subprocess_check_output.assert_has_calls(
[
mock.call(
[
"docker",
"compose",
"-f",
f"{service_path}/{DEVSERVICES_DIR_NAME}/{CONFIG_FILE_NAME}",
"config",
"--services",
],
text=True,
env=mock.ANY,
),
mock.call(
[
"docker",
"compose",
"-p",
"example-service",
"-f",
f"{service_path}/{DEVSERVICES_DIR_NAME}/{CONFIG_FILE_NAME}",
"ps",
"--format",
"{{.Name}}",
],
text=True,
),
]
)

mock_run.assert_called_with(
[
"docker",
Expand Down Expand Up @@ -548,6 +641,37 @@ def test_up_mode_simple(

mock_create_devservices_network.assert_called_once()

mock_subprocess_check_output.assert_has_calls(
[
mock.call(
[
"docker",
"compose",
"-f",
f"{service_path}/{DEVSERVICES_DIR_NAME}/{CONFIG_FILE_NAME}",
"config",
"--services",
],
text=True,
env=mock.ANY,
),
mock.call(
[
"docker",
"compose",
"-p",
"example-service",
"-f",
f"{service_path}/{DEVSERVICES_DIR_NAME}/{CONFIG_FILE_NAME}",
"ps",
"--format",
"{{.Name}}",
],
text=True,
),
]
)

mock_run.assert_called_with(
[
"docker",
Expand Down

0 comments on commit 4be853f

Please sign in to comment.