mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-08-24 00:11:55 +00:00
test: fix docker-gen flaky tests
This commit is contained in:
@@ -27,4 +27,4 @@ services:
|
||||
- "80"
|
||||
environment:
|
||||
WEB_PORTS: "80"
|
||||
VIRTUAL_HOST: whoami.nginx.container.docker
|
||||
VIRTUAL_HOST: whoami.nginx-proxy.tld
|
||||
|
@@ -11,12 +11,12 @@ pytestmark = pytest.mark.skipif(
|
||||
|
||||
|
||||
def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://unknown.nginx.container.docker/")
|
||||
r = nginxproxy.get("http://unknown.nginx-proxy.tld/")
|
||||
assert r.status_code == 503
|
||||
|
||||
|
||||
def test_forwards_to_whoami(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://whoami.nginx.container.docker/")
|
||||
r = nginxproxy.get("http://whoami.nginx-proxy.tld/")
|
||||
assert r.status_code == 200
|
||||
whoami_container = docker_compose.containers.get("whoami")
|
||||
assert r.text == f"I'm {whoami_container.id[:12]}\n"
|
||||
|
@@ -40,6 +40,6 @@ services:
|
||||
- "80"
|
||||
environment:
|
||||
WEB_PORTS: "80"
|
||||
VIRTUAL_HOST: whoami2.nginx.container.docker
|
||||
VIRTUAL_HOST: whoami2.nginx-proxy.tld
|
||||
networks:
|
||||
- proxy
|
||||
|
@@ -11,12 +11,12 @@ pytestmark = pytest.mark.skipif(
|
||||
|
||||
|
||||
def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://unknown.nginx.container.docker/")
|
||||
r = nginxproxy.get("http://unknown.nginx-proxy.tld/")
|
||||
assert r.status_code == 503
|
||||
|
||||
|
||||
def test_forwards_to_whoami(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://whoami2.nginx.container.docker/")
|
||||
r = nginxproxy.get("http://whoami2.nginx-proxy.tld/")
|
||||
assert r.status_code == 200
|
||||
whoami_container = docker_compose.containers.get("whoami2")
|
||||
assert r.text == f"I'm {whoami_container.id[:12]}\n"
|
||||
|
@@ -38,6 +38,6 @@ services:
|
||||
- "80"
|
||||
environment:
|
||||
WEB_PORTS: "80"
|
||||
VIRTUAL_HOST: whoami2.nginx.container.docker
|
||||
VIRTUAL_HOST: whoami2.nginx-proxy.tld
|
||||
networks:
|
||||
- proxy
|
||||
|
@@ -11,12 +11,12 @@ pytestmark = pytest.mark.skipif(
|
||||
|
||||
|
||||
def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://unknown.nginx.container.docker/")
|
||||
r = nginxproxy.get("http://unknown.nginx-proxy.tld/")
|
||||
assert r.status_code == 503
|
||||
|
||||
|
||||
def test_forwards_to_whoami(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://whoami2.nginx.container.docker/")
|
||||
r = nginxproxy.get("http://whoami2.nginx-proxy.tld/")
|
||||
assert r.status_code == 200
|
||||
whoami_container = docker_compose.containers.get("whoami2")
|
||||
assert r.text == f"I'm {whoami_container.id[:12]}\n"
|
||||
|
Reference in New Issue
Block a user