diff --git a/tests/container_test.py b/tests/container_test.py index 2f8ffaf..7baaf6f 100644 --- a/tests/container_test.py +++ b/tests/container_test.py @@ -19,14 +19,13 @@ def test_container_count(dockerc): ), "Wrong number of containers were started." -<<<<<<< HEAD # TODO: Implement this test. See cisagov/guacscanner-docker#3 for # more details. # def test_wait_for_ready(main_container): # """Wait for container to be ready.""" # TIMEOUT = 10 # for i in range(TIMEOUT): -# if READY_MESSAGE in main_container.logs().decode("utf-8"): +# if READY_MESSAGE in main_container.logs(): # break # time.sleep(1) # else: @@ -34,55 +33,26 @@ def test_container_count(dockerc): # f"Container does not seem ready. " # f'Expected "{READY_MESSAGE}" in the log within {TIMEOUT} seconds.' # ) -======= -def test_wait_for_ready(main_container): - """Wait for container to be ready.""" - TIMEOUT = 10 - for i in range(TIMEOUT): - if READY_MESSAGE in main_container.logs(): - break - time.sleep(1) - else: - raise Exception( - f"Container does not seem ready. " - f'Expected "{READY_MESSAGE}" in the log within {TIMEOUT} seconds.' - ) ->>>>>>> a9d6c92ea3ca2760e4a18276d06c668058dd3670 def test_wait_for_exits(dockerc, main_container, version_container): """Wait for containers to exit.""" -<<<<<<< HEAD - # assert main_container.wait() == 0, "Container service (main) did not exit cleanly" assert ( - main_container.wait() == 1 + dockerc.wait(main_container.id) == 1 ), "Container service (main) did not exit as expected" -======= ->>>>>>> a9d6c92ea3ca2760e4a18276d06c668058dd3670 - assert ( - dockerc.wait(main_container.id) == 0 - ), "Container service (main) did not exit cleanly" assert ( dockerc.wait(version_container.id) == 0 ), "Container service (version) did not exit cleanly" -<<<<<<< HEAD # TODO: Implement this test. See cisagov/guacscanner-docker#3 for # more details. -# def test_output(main_container): +# def test_output(dockerc, main_container): # """Verify the container had the correct output.""" -# main_container.wait() # make sure container exited if running test isolated -# log_output = main_container.logs().decode("utf-8") +# # make sure container exited if running test isolated +# dockerc.wait(main_container.id) +# log_output = main_container.logs() # assert SECRET_QUOTE in log_output, "Secret not found in log output." -======= -def test_output(dockerc, main_container): - """Verify the container had the correct output.""" - # make sure container exited if running test isolated - dockerc.wait(main_container.id) - log_output = main_container.logs() - assert SECRET_QUOTE in log_output, "Secret not found in log output." ->>>>>>> a9d6c92ea3ca2760e4a18276d06c668058dd3670 @pytest.mark.skipif(