forked from p15670423/monkey
UT: Add test for TCPScanConfigurationSchema port validation
This commit is contained in:
parent
cb97e021a7
commit
5a6173163b
|
@ -135,6 +135,17 @@ 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]])
|
||||||
|
def test_tcp_scan_configuration_schema__ports_out_of_range(ports):
|
||||||
|
schema = TCPScanConfigurationSchema()
|
||||||
|
|
||||||
|
invalid_ports_configuration = TCP_SCAN_CONFIGURATION.copy()
|
||||||
|
invalid_ports_configuration["ports"] = ports
|
||||||
|
|
||||||
|
with pytest.raises(ValidationError):
|
||||||
|
schema.load(invalid_ports_configuration)
|
||||||
|
|
||||||
|
|
||||||
def test_network_scan_configuration():
|
def test_network_scan_configuration():
|
||||||
schema = NetworkScanConfigurationSchema()
|
schema = NetworkScanConfigurationSchema()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue