Improve EMC config validations

This commit is contained in:
Matthias
2022-09-24 16:38:56 +02:00
parent 585342f193
commit 873eb5f2ca
4 changed files with 72 additions and 28 deletions

View File

@@ -11,7 +11,6 @@ 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
@@ -73,23 +72,12 @@ def test_emc_shutdown(patched_emc, caplog):
assert not log_has("Stopping ExternalMessageConsumer", caplog)
def test_emc_init(patched_emc, default_conf):
def test_emc_init(patched_emc):
# Test the settings were set correctly
assert patched_emc.initial_candle_limit <= 1500
assert patched_emc.wait_timeout > 0
assert patched_emc.sleep_time > 0
default_conf.update({
"external_message_consumer": {
"enabled": True,
"producers": []
}
})
dataprovider = DataProvider(default_conf, None, None, None)
with pytest.raises(OperationalException,
match="You must specify at least 1 Producer to connect to."):
ExternalMessageConsumer(default_conf, dataprovider)
# Parametrize this?
def test_emc_handle_producer_message(patched_emc, caplog, ohlcv_history):