UT: Add test for TCPScanConfigurationSchema timeout validation

This commit is contained in:
Shreya Malviya 2022-07-27 16:48:43 +05:30
parent fbf3e15f02
commit f870ce0ab3
1 changed files with 10 additions and 0 deletions

View File

@ -146,6 +146,16 @@ def test_tcp_scan_configuration_schema__ports_out_of_range(ports):
schema.load(invalid_ports_configuration) schema.load(invalid_ports_configuration)
def test_tcp_scan_configuration_schema__negative_timeout():
schema = TCPScanConfigurationSchema()
negative_timeout_configuration = TCP_SCAN_CONFIGURATION.copy()
negative_timeout_configuration["timeout"] = -1
with pytest.raises(ValidationError):
schema.load(negative_timeout_configuration)
def test_network_scan_configuration(): def test_network_scan_configuration():
schema = NetworkScanConfigurationSchema() schema = NetworkScanConfigurationSchema()