1
0
mirror of https://github.com/thib8956/nginx-proxy synced 2025-07-03 23:35:46 +00:00

tests: supplemental test for certificate selection

This commit is contained in:
Nicolas Duchon
2024-12-08 20:05:42 +01:00
parent c67739f1cc
commit 56a4bb8601
6 changed files with 229 additions and 19 deletions

View File

@ -3,10 +3,10 @@ import pytest
@pytest.mark.parametrize("host,expected_cert_ok,expected_cert", [
("nginx-proxy.tld", True, "nginx-proxy.tld"),
("web1.nginx-proxy.tld", True, "nginx-proxy.tld"),
("sub.web1.nginx-proxy.tld", False, ""),
("web2.nginx-proxy.tld", True, "web2.nginx-proxy.tld"),
("https://nginx-proxy.tld", True, "nginx-proxy.tld"),
("https://www.nginx-proxy.tld", True, "nginx-proxy.tld"),
("http://subdomain.www.nginx-proxy.tld", False, ""),
("https://web1.nginx-proxy.tld", True, "web1.nginx-proxy.tld"),
])
def test_certificate_selection(
docker_compose,
@ -15,7 +15,7 @@ def test_certificate_selection(
expected_cert_ok: bool,
expected_cert: str,
):
r = nginxproxy.get(f"http://{host}/nginx-proxy-debug")
r = nginxproxy.get(f"{host}/nginx-proxy-debug")
assert r.status_code == 200
try:
jsonResponse = json.loads(r.text)