Improve emit_df testcase

This commit is contained in:
Matthias 2022-10-26 20:31:31 +02:00
parent 5e533b550f
commit 687eefa06e

View File

@ -207,12 +207,18 @@ def test_emit_df(mocker, default_conf, ohlcv_history):
assert send_mock.call_count == 0 assert send_mock.call_count == 0
# Rpc is added, we call emit, should call send_msg # Rpc is added, we call emit, should call send_msg
dataprovider._emit_df(pair, ohlcv_history) dataprovider._emit_df(pair, ohlcv_history, False)
assert send_mock.call_count == 1 assert send_mock.call_count == 1
send_mock.reset_mock()
dataprovider._emit_df(pair, ohlcv_history, True)
assert send_mock.call_count == 2
send_mock.reset_mock()
# No rpc added, emit called, should not call send_msg # No rpc added, emit called, should not call send_msg
dataprovider_no_rpc._emit_df(pair, ohlcv_history) dataprovider_no_rpc._emit_df(pair, ohlcv_history, False)
assert send_mock.call_count == 1 assert send_mock.call_count == 0
def test_refresh(mocker, default_conf, ohlcv_history): def test_refresh(mocker, default_conf, ohlcv_history):