Add I Am Alive Message

This commit is contained in:
Matthias
2019-10-25 15:00:16 +02:00
parent 8201f70a80
commit 0773a65333
4 changed files with 36 additions and 1 deletions

View File

@@ -3648,3 +3648,27 @@ def test_startup_trade_reinit(default_conf, edge_conf, mocker):
ftbot = get_patched_freqtradebot(mocker, edge_conf)
ftbot.startup()
assert reinit_mock.call_count == 0
def test_process_i_am_alive(default_conf, mocker, caplog):
patch_RPCManager(mocker)
patch_exchange(mocker)
mocker.patch('freqtrade.exchange.Exchange.exchange_has', MagicMock(return_value=True))
ftbot = get_patched_freqtradebot(mocker, default_conf)
message = "I am alive."
ftbot.process()
assert log_has(message, caplog)
assert ftbot._last_alive_msg != 0
caplog.clear()
# Message is not shown before interval is up
ftbot.process()
assert not log_has(message, caplog)
caplog.clear()
# Set clock - 70 seconds
ftbot._last_alive_msg -= 70
ftbot.process()
assert log_has(message, caplog)