Add tests for dataprovider send-message methods

This commit is contained in:
Matthias
2022-07-27 06:32:23 +02:00
parent 7bac054668
commit 0adfa4d9ef
4 changed files with 54 additions and 2 deletions

View File

@@ -311,3 +311,22 @@ def test_no_exchange_mode(default_conf):
with pytest.raises(OperationalException, match=message):
dp.available_pairs()
def test_dp_send_msg(default_conf):
default_conf["runmode"] = RunMode.DRY_RUN
default_conf["timeframe"] = '1h'
dp = DataProvider(default_conf, None)
msg = 'Test message'
dp.send_msg(msg)
assert msg in dp._msg_queue
dp._msg_queue.pop()
assert msg not in dp._msg_queue
# Message is not resent due to caching
dp.send_msg(msg)
assert msg not in dp._msg_queue
dp.send_msg(msg, always_send=True)
assert msg in dp._msg_queue