Enhance test verifying that locks are not replaced
This commit is contained in:
parent
bb51da8297
commit
57a4044eb0
@ -1,5 +1,5 @@
|
|||||||
import random
|
import random
|
||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta, timezone
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -123,6 +123,12 @@ def test_stoploss_guard(mocker, default_conf, fee, caplog):
|
|||||||
assert log_has_re(message, caplog)
|
assert log_has_re(message, caplog)
|
||||||
assert PairLocks.is_global_lock()
|
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.parametrize('only_per_pair', [False, True])
|
||||||
@pytest.mark.usefixtures("init_persistence")
|
@pytest.mark.usefixtures("init_persistence")
|
||||||
|
Loading…
Reference in New Issue
Block a user