From ba1115cf79e5ff7d43f9c64654ae6fd8591ad6ca Mon Sep 17 00:00:00 2001 From: Shreya Malviya Date: Wed, 27 Jul 2022 17:52:01 +0530 Subject: [PATCH] UT: Extract invalid ports to a variable in test_agent_configuration.py --- .../common/configuration/test_agent_configuration.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monkey/tests/unit_tests/common/configuration/test_agent_configuration.py b/monkey/tests/unit_tests/common/configuration/test_agent_configuration.py index 9b2f1ba47..ec1f884e1 100644 --- a/monkey/tests/unit_tests/common/configuration/test_agent_configuration.py +++ b/monkey/tests/unit_tests/common/configuration/test_agent_configuration.py @@ -48,6 +48,8 @@ from common.agent_configuration.agent_sub_configurations import ( PropagationConfiguration, ) +INVALID_PORTS = [[-1, 1, 2], [1, 2, 99999]] + def test_build_plugin_configuration(): schema = PluginConfigurationSchema() @@ -145,7 +147,7 @@ def test_tcp_scan_configuration_schema(): assert config.ports == tuple(PORTS) -@pytest.mark.parametrize("ports", [[-1, 1, 2], [1, 2, 99999]]) +@pytest.mark.parametrize("ports", INVALID_PORTS) def test_tcp_scan_configuration_schema__ports_out_of_range(ports): schema = TCPScanConfigurationSchema() @@ -191,7 +193,7 @@ def test_exploitation_options_configuration_schema(): assert config.http_ports == tuple(ports) -@pytest.mark.parametrize("ports", [[-1, 1, 2], [1, 2, 99999]]) +@pytest.mark.parametrize("ports", INVALID_PORTS) def test_exploitation_options_configuration_schema__ports_out_of_range(ports): schema = ExploitationOptionsConfigurationSchema()