1515from testcontainers .core .config import testcontainers_config
1616from testcontainers .core .container import DockerContainer
1717from testcontainers .core .docker_client import DockerClient
18- from testcontainers .core .waiting_utils import wait_container_is_ready
18+ from testcontainers .core .waiting_utils import wait_for_logs
1919
2020from testcontainers .registry import DockerRegistryContainer
2121from testcontainers .core .utils import is_mac
@@ -43,22 +43,22 @@ def test_missing_on_private_registry(monkeypatch):
4343 with pytest .raises (NotFound ):
4444 # Test a container with image from private registry
4545 with DockerContainer (f"{ registry_url } /{ image } :{ tag } " ) as test_container :
46- wait_container_is_ready (test_container )
46+ wait_for_logs (test_container , "Hello from Docker!" )
4747
4848
4949@pytest .mark .skipif (
5050 is_mac (),
5151 reason = "Docker Desktop on macOS does not support local insecure registries over HTTP without modifying daemon settings" ,
5252)
5353@pytest .mark .parametrize (
54- "image,tag,username,password" ,
54+ "image,tag,username,password,expected_output " ,
5555 [
56- ("nginx" , "test" , "user" , "pass" ),
57- ("hello-world" , "latest" , "new_user" , "new_pass" ),
58- ("alpine" , "3.12" , None , None ),
56+ ("nginx" , "test" , "user" , "pass" , "start worker processes" ),
57+ ("hello-world" , "latest" , "new_user" , "new_pass" , "Hello from Docker!" ),
58+ ("alpine" , "3.12" , None , None , "" ),
5959 ],
6060)
61- def test_with_private_registry (image , tag , username , password , monkeypatch ):
61+ def test_with_private_registry (image , tag , username , password , expected_output , monkeypatch ):
6262 client = DockerClient ().client
6363
6464 with DockerRegistryContainer (username = username , password = password ) as registry :
@@ -85,7 +85,7 @@ def test_with_private_registry(image, tag, username, password, monkeypatch):
8585
8686 # Test a container with image from private registry
8787 with DockerContainer (f"{ registry_url } /{ image } :{ tag } " ) as test_container :
88- wait_container_is_ready (test_container )
88+ wait_for_logs (test_container , expected_output )
8989
9090 # cleanup
9191 client .images .remove (f"{ registry_url } /{ image } :{ tag } " )
0 commit comments