UT: Add test for ExploitationOptionsConfigurationSchema port validation
This commit is contained in:
parent
20ab2c3eca
commit
95a6c14334
|
@ -191,6 +191,16 @@ 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]])
|
||||||
|
def test_exploitation_options_configuration_schema__ports_out_of_range(ports):
|
||||||
|
schema = ExploitationOptionsConfigurationSchema()
|
||||||
|
|
||||||
|
invalid_ports_configuration = {"http_ports": ports}
|
||||||
|
|
||||||
|
with pytest.raises(ValidationError):
|
||||||
|
schema.load(invalid_ports_configuration)
|
||||||
|
|
||||||
|
|
||||||
def test_exploiter_configuration_schema():
|
def test_exploiter_configuration_schema():
|
||||||
name = "bond"
|
name = "bond"
|
||||||
options = {"gun": "Walther PPK", "car": "Aston Martin DB5"}
|
options = {"gun": "Walther PPK", "car": "Aston Martin DB5"}
|
||||||
|
|
Loading…
Reference in New Issue