UT: Add test for AgentConfigurationSchema tunnel open time validation

This commit is contained in:
Shreya Malviya 2022-07-27 18:32:02 +05:30
parent a603b16573
commit e6108d0fc7
1 changed files with 8 additions and 0 deletions

View File

@ -239,6 +239,14 @@ def test_agent_configuration():
assert json.loads(config_json) == AGENT_CONFIGURATION
def test_agent_configuration__negative_keep_tunnel_open_time():
negative_keep_tunnel_open_time_configuration = AGENT_CONFIGURATION.copy()
negative_keep_tunnel_open_time_configuration["keep_tunnel_open_time"] = -1
with pytest.raises(InvalidConfigurationError):
AgentConfiguration.from_mapping(negative_keep_tunnel_open_time_configuration)
def test_incorrect_type():
valid_config = AgentConfiguration.from_mapping(AGENT_CONFIGURATION)
with pytest.raises(InvalidConfigurationError):