mirror of
https://github.com/thib8956/nginx-proxy
synced 2025-07-02 06:45:45 +00:00
tests: Add tests for how Let's Encrypt ACME challenge is handled
At the moment no changes to functionality are done, only the current behavior is captured.
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import pytest
|
||||
from requests import ConnectionError
|
||||
|
||||
@pytest.mark.parametrize("path", ["web1", "web2"])
|
||||
def test_web1_http_redirects_to_https(docker_compose, nginxproxy, path):
|
||||
@ -13,3 +14,11 @@ def test_web1_https_is_forwarded(docker_compose, nginxproxy, path, port):
|
||||
assert r.status_code == 200
|
||||
assert "answer from port %d\n" % port in r.text
|
||||
|
||||
|
||||
@pytest.mark.parametrize("port", [81, 82])
|
||||
def test_acme_challenge_does_not_work(docker_compose, nginxproxy, acme_challenge_path, port):
|
||||
with pytest.raises(ConnectionError):
|
||||
nginxproxy.get(
|
||||
f"http://www.nginx-proxy.tld:{port}/{acme_challenge_path}",
|
||||
allow_redirects=False
|
||||
)
|
||||
|
Reference in New Issue
Block a user