test_dockergen.py 666 B

12345678910111213141516171819202122232425
  1. import os
  2. import pytest
  3. pytestmark = pytest.mark.skipif(
  4. True,
  5. reason="This test intefers with the other tests, and might no longer be needed."
  6. )
  7. def test_unknown_virtual_host_is_503(docker_compose, nginxproxy):
  8. r = nginxproxy.get("http://unknown.nginx.container.docker/")
  9. assert r.status_code == 503
  10. def test_forwards_to_whoami(docker_compose, nginxproxy):
  11. r = nginxproxy.get("http://whoami.nginx.container.docker/")
  12. assert r.status_code == 200
  13. whoami_container = docker_compose.containers.get("whoami")
  14. assert r.text == f"I'm {whoami_container.id[:12]}\n"
  15. if __name__ == "__main__":
  16. import doctest
  17. doctest.testmod()