Split protection-notification into global and per-pair

This commit is contained in:
Matthias
2021-09-20 19:23:40 +02:00
parent a0fb43c6ca
commit dd0db7ee5d
6 changed files with 26 additions and 4 deletions

View File

@@ -1326,6 +1326,19 @@ def test_send_msg_protection_notification(default_conf, mocker, time_machine) ->
assert (msg_mock.call_args[0][0] == "*Protection* triggered due to randreason. "
"ETH/BTC will be locked until 2021-09-01 05:10:00.")
msg_mock.reset_mock()
# Test global protection
msg = {
'type': RPCMessageType.PROTECTION_TRIGGER_GLOBAL,
}
lock = PairLocks.lock_pair('*', arrow.utcnow().shift(minutes=100).datetime, 'randreason')
msg.update(lock.to_json())
telegram.send_msg(msg)
assert (msg_mock.call_args[0][0] == "*Protection* triggered due to randreason. "
"All pairs will be locked until 2021-09-01 06:45:00.")
def test_send_msg_buy_fill_notification(default_conf, mocker) -> None: