2
0

test_proxy-debug-flag.py 702 B

123456789101112
  1. import pytest
  2. import re
  3. def test_debug_info_is_present_in_nginx_generated_conf(docker_compose, nginxproxy):
  4. conf = nginxproxy.get_conf().decode('ASCII')
  5. assert re.search(r"# Exposed ports: \[\{[^}]+\s+80\s+tcp \} \{[^}]+\s+81\s+tcp \}\]", conf) or \
  6. re.search(r"# Exposed ports: \[\{[^}]+\s+81\s+tcp \} \{[^}]+\s+80\s+tcp \}\]", conf)
  7. assert re.search(r"# Exposed ports: \[\{[^}]+\s+82\s+tcp \} \{[^}]+\s+83\s+tcp \}\]", conf) or \
  8. re.search(r"# Exposed ports: \[\{[^}]+\s+83\s+tcp \} \{[^}]+\s+82\s+tcp \}\]", conf)
  9. assert "# Default virtual port: 80" in conf
  10. assert "# VIRTUAL_PORT: 82" in conf
  11. assert conf.count("# /!\\ Virtual port not exposed") == 1