mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-01 14:25:46 +00:00
TESTS: reorganize tests into subfolders
This commit is contained in:
7
test2/test_multiple-ports/test_VIRTUAL_PORT.py
Normal file
7
test2/test_multiple-ports/test_VIRTUAL_PORT.py
Normal file
@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
|
||||
def test_answer_is_served_from_chosen_port(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web.nginx-proxy.tld/port")
|
||||
assert r.status_code == 200
|
||||
assert "answer from port 90\n" in r.text
|
14
test2/test_multiple-ports/test_VIRTUAL_PORT.yml
Normal file
14
test2/test_multiple-ports/test_VIRTUAL_PORT.yml
Normal file
@ -0,0 +1,14 @@
|
||||
web:
|
||||
image: web
|
||||
expose:
|
||||
- "80"
|
||||
- "90"
|
||||
environment:
|
||||
WEB_PORTS: "80 90"
|
||||
VIRTUAL_HOST: "web.nginx-proxy.tld"
|
||||
VIRTUAL_PORT: 90
|
||||
|
||||
sut:
|
||||
image: jwilder/nginx-proxy:test
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
7
test2/test_multiple-ports/test_default-80.py
Normal file
7
test2/test_multiple-ports/test_default-80.py
Normal file
@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
|
||||
def test_answer_is_served_from_port_80_by_default(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web.nginx-proxy.tld/port")
|
||||
assert r.status_code == 200
|
||||
assert "answer from port 80\n" in r.text
|
13
test2/test_multiple-ports/test_default-80.yml
Normal file
13
test2/test_multiple-ports/test_default-80.yml
Normal file
@ -0,0 +1,13 @@
|
||||
web:
|
||||
image: web
|
||||
expose:
|
||||
- "80"
|
||||
- "81"
|
||||
environment:
|
||||
WEB_PORTS: "80 81"
|
||||
VIRTUAL_HOST: "web.nginx-proxy.tld"
|
||||
|
||||
sut:
|
||||
image: jwilder/nginx-proxy:test
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
7
test2/test_multiple-ports/test_single-port-not-80.py
Normal file
7
test2/test_multiple-ports/test_single-port-not-80.py
Normal file
@ -0,0 +1,7 @@
|
||||
import pytest
|
||||
|
||||
|
||||
def test_answer_is_served_from_exposed_port_even_if_not_80(docker_compose, nginxproxy):
|
||||
r = nginxproxy.get("http://web.nginx-proxy.tld/port")
|
||||
assert r.status_code == 200
|
||||
assert "answer from port 81\n" in r.text
|
13
test2/test_multiple-ports/test_single-port-not-80.yml
Normal file
13
test2/test_multiple-ports/test_single-port-not-80.yml
Normal file
@ -0,0 +1,13 @@
|
||||
web:
|
||||
image: web
|
||||
expose:
|
||||
- "81"
|
||||
environment:
|
||||
WEB_PORTS: "81"
|
||||
VIRTUAL_HOST: "web.nginx-proxy.tld"
|
||||
|
||||
|
||||
sut:
|
||||
image: jwilder/nginx-proxy:test
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
Reference in New Issue
Block a user