test_location-override.py 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. def test_explicit_root_nohash(docker_compose, nginxproxy):
  2. r = nginxproxy.get("http://explicit-root-nohash.nginx-proxy.test/port")
  3. assert r.status_code == 418
  4. r = nginxproxy.get("http://explicit-root-nohash.nginx-proxy.test/foo/port")
  5. assert r.status_code == 200
  6. assert r.text == "answer from port 82\n"
  7. def test_explicit_root_hash(docker_compose, nginxproxy):
  8. r = nginxproxy.get("http://explicit-root-hash.nginx-proxy.test/port")
  9. assert r.status_code == 418
  10. r = nginxproxy.get("http://explicit-root-hash.nginx-proxy.test/foo/port")
  11. assert r.status_code == 200
  12. assert r.text == "answer from port 82\n"
  13. def test_explicit_root_hash_and_nohash(docker_compose, nginxproxy):
  14. r = nginxproxy.get("http://explicit-root-hash-and-nohash.nginx-proxy.test/port")
  15. assert r.status_code == 418
  16. r = nginxproxy.get("http://explicit-root-hash-and-nohash.nginx-proxy.test/foo/port")
  17. assert r.status_code == 200
  18. assert r.text == "answer from port 82\n"
  19. def test_explicit_nonroot(docker_compose, nginxproxy):
  20. r = nginxproxy.get("http://explicit-nonroot.nginx-proxy.test/port")
  21. assert r.status_code == 200
  22. assert r.text == "answer from port 81\n"
  23. r = nginxproxy.get("http://explicit-nonroot.nginx-proxy.test/foo/port")
  24. assert r.status_code == 418
  25. def test_implicit_root_nohash(docker_compose, nginxproxy):
  26. r = nginxproxy.get("http://implicit-root-nohash.nginx-proxy.test/port")
  27. assert r.status_code == 418
  28. def test_implicit_root_hash(docker_compose, nginxproxy):
  29. r = nginxproxy.get("http://implicit-root-hash.nginx-proxy.test/port")
  30. assert r.status_code == 418
  31. def test_implicit_root_hash_and_nohash(docker_compose, nginxproxy):
  32. r = nginxproxy.get("http://implicit-root-hash-and-nohash.nginx-proxy.test/port")
  33. assert r.status_code == 418