UT: Add test for PropagationConfigurationSchema maximum depth validation

This commit is contained in:
Shreya Malviya 2022-07-27 18:16:04 +05:30
parent c53d41645c
commit afc2021470
1 changed files with 11 additions and 0 deletions

View File

@ -225,6 +225,17 @@ def test_propagation_configuration():
assert config_dict == PROPAGATION_CONFIGURATION
@pytest.mark.parametrize("depth", [-1, 0])
def test_propagation_configuration__invalid_maximum_depth(depth):
schema = PropagationConfigurationSchema()
invalid_maximum_depth_configuration = PROPAGATION_CONFIGURATION.copy()
invalid_maximum_depth_configuration["maximum_depth"] = depth
with pytest.raises(ValidationError):
schema.load(invalid_maximum_depth_configuration)
def test_agent_configuration():
config = AgentConfiguration.from_mapping(AGENT_CONFIGURATION)
config_json = AgentConfiguration.to_json(config)