forked from p15670423/monkey
UT: Extract invalid ports to a variable in test_agent_configuration.py
This commit is contained in:
parent
95a6c14334
commit
ba1115cf79
|
@ -48,6 +48,8 @@ from common.agent_configuration.agent_sub_configurations import (
|
||||||
PropagationConfiguration,
|
PropagationConfiguration,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
INVALID_PORTS = [[-1, 1, 2], [1, 2, 99999]]
|
||||||
|
|
||||||
|
|
||||||
def test_build_plugin_configuration():
|
def test_build_plugin_configuration():
|
||||||
schema = PluginConfigurationSchema()
|
schema = PluginConfigurationSchema()
|
||||||
|
@ -145,7 +147,7 @@ def test_tcp_scan_configuration_schema():
|
||||||
assert config.ports == tuple(PORTS)
|
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):
|
def test_tcp_scan_configuration_schema__ports_out_of_range(ports):
|
||||||
schema = TCPScanConfigurationSchema()
|
schema = TCPScanConfigurationSchema()
|
||||||
|
|
||||||
|
@ -191,7 +193,7 @@ def test_exploitation_options_configuration_schema():
|
||||||
assert config.http_ports == tuple(ports)
|
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):
|
def test_exploitation_options_configuration_schema__ports_out_of_range(ports):
|
||||||
schema = ExploitationOptionsConfigurationSchema()
|
schema = ExploitationOptionsConfigurationSchema()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue