Enhance test verifying that locks are not replaced

This commit is contained in:
Matthias 2020-11-29 11:37:10 +01:00
parent bb51da8297
commit 57a4044eb0

View File

@ -1,5 +1,5 @@
import random
from datetime import datetime, timedelta
from datetime import datetime, timedelta, timezone
import pytest
@ -123,6 +123,12 @@ def test_stoploss_guard(mocker, default_conf, fee, caplog):
assert log_has_re(message, caplog)
assert PairLocks.is_global_lock()
# Test 5m after lock-period - this should try and relock the pair, but end-time
# should be the previous end-time
end_time = PairLocks.get_pair_longest_lock('*').lock_end_time + timedelta(minutes=5)
assert freqtrade.protections.global_stop(end_time)
assert not PairLocks.is_global_lock(end_time)
@pytest.mark.parametrize('only_per_pair', [False, True])
@pytest.mark.usefixtures("init_persistence")