Add I Am Alive Message
This commit is contained in:
@@ -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)
|
||||
|
Reference in New Issue
Block a user