Skip to content

Commit

Permalink
Merge pull request #881 from p12tic/test-fix-teardown
Browse files Browse the repository at this point in the history
tests: Properly tear down containers in extends_w_file_subdir test
  • Loading branch information
p12tic committed Mar 8, 2024
2 parents 6841619 + 1a24cde commit de8f545
Showing 1 changed file with 14 additions and 9 deletions.
23 changes: 14 additions & 9 deletions tests/test_podman_compose.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,20 +51,25 @@ def test_extends_w_file_subdir(self):
'{{.Image}}',
]

command_down = [
"podman",
"rmi",
"--force",
"localhost/subdir_test:me",
"docker.io/library/busybox",
]

self.run_subprocess_assert_returncode(command_up)
# check container was created and exists
out, _ = self.run_subprocess_assert_returncode(command_check_container)
self.assertEqual(out, b'localhost/subdir_test:me\n')
# cleanup test image(tags)
self.run_subprocess_assert_returncode(command_down)
self.run_subprocess_assert_returncode([
str(main_path.joinpath("podman_compose.py")),
"-f",
str(main_path.joinpath("tests", "extends_w_file_subdir", "docker-compose.yml")),
"down",
])

self.run_subprocess_assert_returncode([
"podman",
"rmi",
"--force",
"localhost/subdir_test:me",
])

# check container did not exists anymore
out, _ = self.run_subprocess_assert_returncode(command_check_container)
self.assertEqual(out, b'')
Expand Down

0 comments on commit de8f545

Please sign in to comment.