Add unlock_at config test, simplify validation

This commit is contained in:
Matthias
2024-07-16 07:26:41 +02:00
parent a3c52445ee
commit d590ab003f
2 changed files with 21 additions and 9 deletions

View File

@@ -840,6 +840,21 @@ def test_validate_whitelist(default_conf):
],
r"Protections must specify either `stop_duration`.*",
),
(
[
{
"method": "StoplossGuard",
"lookback_period": 20,
"stop_duration": 10,
"unlock_at": "20:02",
}
],
r"Protections must specify either `unlock_at`, `stop_duration` or.*",
),
(
[{"method": "StoplossGuard", "lookback_period_candles": 20, "unlock_at": "20:02"}],
None,
),
],
)
def test_validate_protections(default_conf, protconf, expected):