mirror of https://github.com/cirruslabs/tart.git
integration-tests: use HttpWaitStrategy
This commit is contained in:
parent
3f1624e31a
commit
4e0dbcea4b
|
|
@ -1,7 +1,5 @@
|
|||
import requests
|
||||
|
||||
from testcontainers.core.waiting_utils import wait_container_is_ready
|
||||
from testcontainers.core.container import DockerContainer
|
||||
from testcontainers.core.wait_strategies import HttpWaitStrategy
|
||||
|
||||
|
||||
class DockerRegistry(DockerContainer):
|
||||
|
|
@ -10,11 +8,9 @@ class DockerRegistry(DockerContainer):
|
|||
def __init__(self):
|
||||
super().__init__("registry:2")
|
||||
self.with_exposed_ports(self._default_exposed_port)
|
||||
self.waiting_for(HttpWaitStrategy(self._default_exposed_port, "/v2/").for_status_code(200))
|
||||
|
||||
@wait_container_is_ready(requests.exceptions.ConnectionError)
|
||||
def remote_name(self, for_vm: str):
|
||||
exposed_port = self.get_exposed_port(self._default_exposed_port)
|
||||
|
||||
requests.get(f"http://127.0.0.1:{exposed_port}/v2/")
|
||||
|
||||
return f"127.0.0.1:{exposed_port}/tart/{for_vm}:latest"
|
||||
|
|
|
|||
Loading…
Reference in New Issue