2
0

test_acme-http-challenge-location-disabled.py 1.0 KB

123456789101112131415161718192021222324252627
  1. def test_redirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
  2. r = nginxproxy.get(
  3. f"http://web1.nginx-proxy.tld/{acme_challenge_path}",
  4. allow_redirects=False
  5. )
  6. assert r.status_code == 301
  7. def test_redirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
  8. r = nginxproxy.get(
  9. f"http://web2.nginx-proxy.tld/{acme_challenge_path}",
  10. allow_redirects=False
  11. )
  12. assert r.status_code == 200
  13. def test_noredirect_acme_challenge_location_disabled(docker_compose, nginxproxy, acme_challenge_path):
  14. r = nginxproxy.get(
  15. f"http://web3.nginx-proxy.tld/{acme_challenge_path}",
  16. allow_redirects=False
  17. )
  18. assert r.status_code == 404
  19. def test_noredirect_acme_challenge_location_enabled(docker_compose, nginxproxy, acme_challenge_path):
  20. r = nginxproxy.get(
  21. f"http://web4.nginx-proxy.tld/{acme_challenge_path}",
  22. allow_redirects=False
  23. )
  24. assert r.status_code == 200