Change keepalive to heartbeat

This commit is contained in:
Matthias
2019-10-25 19:59:04 +02:00
parent 0773a65333
commit 2f1d9696cd
4 changed files with 21 additions and 20 deletions

View File

@@ -3656,19 +3656,19 @@ def test_process_i_am_alive(default_conf, mocker, caplog):
mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))
ftbot = get_patched_freqtradebot(mocker, default_conf)
message = "I am alive."
message = r"Freqtrade heartbeat. PID=.*"
ftbot.process()
assert log_has(message, caplog)
assert ftbot._last_alive_msg != 0
assert log_has_re(message, caplog)
assert ftbot._heartbeat_msg != 0
caplog.clear()
# Message is not shown before interval is up
ftbot.process()
assert not log_has(message, caplog)
assert not log_has_re(message, caplog)
caplog.clear()
# Set clock - 70 seconds
ftbot._last_alive_msg -= 70
ftbot._heartbeat_msg -= 70
ftbot.process()
assert log_has(message, caplog)
assert log_has_re(message, caplog)