Skip to content

chore(up): cleaning up tests #196

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading