From 92aaea5c6d003676c0da40e4cbc910748a14fe4d Mon Sep 17 00:00:00 2001 From: nghazalibeiklar Date: Mon, 17 Jan 2022 13:04:38 +1100 Subject: [PATCH] Refactored unit tests --- config/server.xml.j2 | 2 -- tests/test_image.py | 10 +++++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/config/server.xml.j2 b/config/server.xml.j2 index 9e1804b..33273f5 100644 --- a/config/server.xml.j2 +++ b/config/server.xml.j2 @@ -21,8 +21,6 @@ proxyPort="{{ atl_proxy_port | default(catalina_connector_proxyport) | default('') }}" maxHttpHeaderSize="{{ atl_tomcat_maxhttpheadersize | default('8192') }}" /> - - diff --git a/tests/test_image.py b/tests/test_image.py index 3786721..1c5bcae 100644 --- a/tests/test_image.py +++ b/tests/test_image.py @@ -175,11 +175,10 @@ def test_server_xml_access_log(docker_cli, image): value = xml.find('.//Context/Valve[@className="org.apache.catalina.valves.RemoteIpValve"]') assert value.get('internalProxies') == environment.get('ATL_TOMCAT_PROXY_INTERNAL_IPS') -def test_server_xml_access_log_default_ver_lt_7_11(docker_cli, image): +def test_server_xml_access_log_disabled(docker_cli, image): environment = { - #'ATL_TOMCAT_ACCESS_LOG': Not defined, + 'ATL_TOMCAT_ACCESS_LOG': 'false', 'ATL_TOMCAT_PROXY_INTERNAL_IPS': '192.168.1.1', - 'CONFLUENCE_VERSION': "7.10.0", } container = run_image(docker_cli, image, environment=environment) @@ -189,10 +188,11 @@ def test_server_xml_access_log_default_ver_lt_7_11(docker_cli, image): value = xml.find('.//Context/Valve[@className="org.apache.catalina.valves.RemoteIpValve"]') assert value is None -def test_server_xml_access_log_disabled(docker_cli, image): +def test_server_xml_access_log_default_ver_lt_7_11(docker_cli, image): environment = { - 'ATL_TOMCAT_ACCESS_LOG': 'false', + #'ATL_TOMCAT_ACCESS_LOG': Not defined, 'ATL_TOMCAT_PROXY_INTERNAL_IPS': '192.168.1.1', + 'CONFLUENCE_VERSION': "7.10.0", } container = run_image(docker_cli, image, environment=environment)