Add tests and documentation for unlock_reason

This commit is contained in:
Matthias
2021-10-30 09:39:40 +02:00
parent e9d71f26b3
commit c579fcfc19
4 changed files with 36 additions and 3 deletions

View File

@@ -575,6 +575,13 @@ def test_is_pair_locked(default_conf):
strategy.unlock_pair(pair)
assert not strategy.is_pair_locked(pair)
# Lock with reason
reason = "TestLockR"
strategy.lock_pair(pair, arrow.now(timezone.utc).shift(minutes=4).datetime, reason)
assert strategy.is_pair_locked(pair)
strategy.unlock_reason(reason)
assert not strategy.is_pair_locked(pair)
pair = 'BTC/USDT'
# Lock until 14:30
lock_time = datetime(2020, 5, 1, 14, 30, 0, tzinfo=timezone.utc)