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
2121
@@ -38,18 +38,18 @@ def test_missing_on_private_registry(monkeypatch):
3838 with pytest .raises (NotFound ):
3939 # Test a container with image from private registry
4040 with DockerContainer (f"{ registry_url } /{ image } :{ tag } " ) as test_container :
41- wait_container_is_ready (test_container )
41+ wait_for_logs (test_container , "Hello from Docker!" )
4242
4343
4444@pytest .mark .parametrize (
45- "image,tag,username,password" ,
45+ "image,tag,username,password,expected_output " ,
4646 [
47- ("nginx" , "test" , "user" , "pass" ),
48- ("hello-world" , "latest" , "new_user" , "new_pass" ),
49- ("alpine" , "3.12" , None , None ),
47+ ("nginx" , "test" , "user" , "pass" , "start worker processes" ),
48+ ("hello-world" , "latest" , "new_user" , "new_pass" , "Hello from Docker!" ),
49+ ("alpine" , "3.12" , None , None , "" ),
5050 ],
5151)
52- def test_with_private_registry (image , tag , username , password , monkeypatch ):
52+ def test_with_private_registry (image , tag , username , password , expected_output , monkeypatch ):
5353 client = DockerClient ().client
5454
5555 with DockerRegistryContainer (username = username , password = password ) as registry :
@@ -76,7 +76,7 @@ def test_with_private_registry(image, tag, username, password, monkeypatch):
7676
7777 # Test a container with image from private registry
7878 with DockerContainer (f"{ registry_url } /{ image } :{ tag } " ) as test_container :
79- wait_container_is_ready (test_container )
79+ wait_for_logs (test_container , expected_output )
8080
8181 # cleanup
8282 client .images .remove (f"{ registry_url } /{ image } :{ tag } " )
0 commit comments