Common: Allow 0 for maximum_depth
This commit is contained in:
parent
8d991f462f
commit
326d128be8
|
@ -1,6 +1,6 @@
|
|||
from typing import Dict, Tuple
|
||||
|
||||
from pydantic import PositiveFloat, PositiveInt, conint, validator
|
||||
from pydantic import PositiveFloat, conint, validator
|
||||
|
||||
from common.base_models import MutableInfectionMonkeyBaseModel
|
||||
|
||||
|
@ -185,6 +185,6 @@ class PropagationConfiguration(MutableInfectionMonkeyBaseModel):
|
|||
:param exploitation: Configuration for exploitation
|
||||
"""
|
||||
|
||||
maximum_depth: PositiveInt
|
||||
maximum_depth: conint(ge=0)
|
||||
network_scan: NetworkScanConfiguration
|
||||
exploitation: ExploitationConfiguration
|
||||
|
|
|
@ -229,6 +229,15 @@ def test_propagation_configuration__invalid_maximum_depth():
|
|||
PropagationConfiguration(**negative_maximum_depth_configuration)
|
||||
|
||||
|
||||
def test_propagation_configuration__maximum_depth_zero():
|
||||
maximum_depth_zero_configuration = PROPAGATION_CONFIGURATION.copy()
|
||||
maximum_depth_zero_configuration["maximum_depth"] = 0
|
||||
|
||||
pc = PropagationConfiguration(**maximum_depth_zero_configuration)
|
||||
|
||||
assert pc.maximum_depth == 0
|
||||
|
||||
|
||||
def test_agent_configuration():
|
||||
config = AgentConfiguration(**AGENT_CONFIGURATION)
|
||||
config_dict = config.dict(simplify=True)
|
||||
|
|
Loading…
Reference in New Issue