emc: Fix potential startup timing issue

This commit is contained in:
Matthias
2022-09-12 19:50:22 +02:00
parent a477b3c244
commit 0052e58917
2 changed files with 7 additions and 8 deletions

View File

@@ -11,6 +11,7 @@ import pytest
import websockets
from freqtrade.data.dataprovider import DataProvider
from freqtrade.exceptions import OperationalException
from freqtrade.rpc.external_message_consumer import ExternalMessageConsumer
from tests.conftest import log_has, log_has_re, log_has_when
@@ -71,7 +72,7 @@ def test_emc_shutdown(patched_emc, caplog):
assert not log_has("Stopping ExternalMessageConsumer", caplog)
def test_emc_init(patched_emc, default_conf, mocker, caplog):
def test_emc_init(patched_emc, default_conf):
# Test the settings were set correctly
assert patched_emc.initial_candle_limit <= 1500
assert patched_emc.wait_timeout > 0
@@ -84,12 +85,10 @@ def test_emc_init(patched_emc, default_conf, mocker, caplog):
}
})
dataprovider = DataProvider(default_conf, None, None, None)
with pytest.raises(ValueError) as exc:
with pytest.raises(OperationalException,
match="You must specify at least 1 Producer to connect to."):
ExternalMessageConsumer(default_conf, dataprovider)
# Make sure we failed because of no producers
assert str(exc.value) == "You must specify at least 1 Producer to connect to."
# Parametrize this?
def test_emc_handle_producer_message(patched_emc, caplog, ohlcv_history):