@@ -8,7 +8,7 @@ def test_container_count(dockerc):
88 """Verify the test composition and container."""
99 # stopped parameter allows non-running containers in results
1010 assert (
11- len (dockerc .containers ( stopped = True )) == 2
11+ len (dockerc .compose . ps ( all = True )) == 2
1212 ), "Wrong number of containers were started."
1313
1414
@@ -17,7 +17,7 @@ def test_container_count(dockerc):
1717# """Wait for container to be ready."""
1818# TIMEOUT = 10
1919# for i in range(TIMEOUT):
20- # if READY_MESSAGE in main_container.logs().decode("utf-8") :
20+ # if READY_MESSAGE in main_container.logs():
2121# break
2222# time.sleep(1)
2323# else:
@@ -28,19 +28,22 @@ def test_container_count(dockerc):
2828
2929
3030# See #60
31- # def test_wait_for_exits(main_container, version_container):
31+ # def test_wait_for_exits(dockerc, main_container, version_container):
3232# """Wait for containers to exit."""
33- # assert main_container.wait() == 0, "Container service (main) did not exit cleanly"
3433# assert (
35- # version_container.wait() == 0
34+ # dockerc.wait(main_container.id) == 0
35+ # ), "Container service (main) did not exit cleanly"
36+ # assert (
37+ # dockerc.wait(version_container.id) == 0
3638# ), "Container service (version) did not exit cleanly"
3739
3840
3941# See #60
40- # def test_output(main_container):
42+ # def test_output(dockerc, main_container):
4143# """Verify the container had the correct output."""
42- # main_container.wait() # make sure container exited if running test isolated
43- # log_output = main_container.logs().decode("utf-8")
44+ # # make sure container exited if running test isolated
45+ # dockerc.wait(main_container.id)
46+ # log_output = main_container.logs()
4447# assert SECRET_QUOTE in log_output, "Secret not found in log output."
4548
4649
@@ -60,10 +63,11 @@ def test_container_count(dockerc):
6063
6164
6265# See #60
63- # def test_log_version(version_container):
66+ # def test_log_version(dockerc, version_container):
6467# """Verify the container outputs the correct version to the logs."""
65- # version_container.wait() # make sure container exited if running test isolated
66- # log_output = version_container.logs().decode("utf-8").strip()
68+ # # make sure container exited if running test isolated
69+ # dockerc.wait(version_container.id)
70+ # log_output = version_container.logs().strip()
6771# pkg_vars = {}
6872# with open(VERSION_FILE) as f:
6973# exec(f.read(), pkg_vars) # nosec
@@ -81,5 +85,6 @@ def test_container_count(dockerc):
8185# exec(f.read(), pkg_vars) # nosec
8286# project_version = pkg_vars["__version__"]
8387# assert (
84- # version_container.labels["org.opencontainers.image.version"] == project_version
88+ # version_container.config.labels["org.opencontainers.image.version"]
89+ # == project_version
8590# ), "Dockerfile version label does not match project version"
0 commit comments