2
0

test_nohttps.py 443 B

123456789101112
  1. import pytest
  2. from requests import ConnectionError
  3. def test_http_is_forwarded(docker_compose, nginxproxy):
  4. r = nginxproxy.get("http://web.nginx-proxy.tld/port", allow_redirects=False)
  5. assert r.status_code == 200
  6. assert "answer from port 83\n" in r.text
  7. def test_https_is_disabled(docker_compose, nginxproxy):
  8. with pytest.raises(ConnectionError):
  9. nginxproxy.get("https://web.nginx-proxy.tld/", allow_redirects=False)