Test that dataprovider is loaded to strategy
This commit is contained in:
parent
01c4f243d4
commit
bd29b7d031
@ -13,12 +13,14 @@ import requests
|
|||||||
|
|
||||||
from freqtrade import (DependencyException, OperationalException,
|
from freqtrade import (DependencyException, OperationalException,
|
||||||
TemporaryError, constants)
|
TemporaryError, constants)
|
||||||
|
from freqtrade.data.dataprovider import DataProvider
|
||||||
from freqtrade.freqtradebot import FreqtradeBot
|
from freqtrade.freqtradebot import FreqtradeBot
|
||||||
from freqtrade.persistence import Trade
|
from freqtrade.persistence import Trade
|
||||||
from freqtrade.rpc import RPCMessageType
|
from freqtrade.rpc import RPCMessageType
|
||||||
from freqtrade.state import State
|
from freqtrade.state import State
|
||||||
from freqtrade.strategy.interface import SellType, SellCheckTuple
|
from freqtrade.strategy.interface import SellCheckTuple, SellType
|
||||||
from freqtrade.tests.conftest import log_has, log_has_re, patch_exchange, patch_edge, patch_wallet
|
from freqtrade.tests.conftest import (log_has, log_has_re, patch_edge,
|
||||||
|
patch_exchange, patch_wallet)
|
||||||
|
|
||||||
|
|
||||||
# Functions for recurrent object patching
|
# Functions for recurrent object patching
|
||||||
@ -88,6 +90,10 @@ def test_worker_running(mocker, default_conf, caplog) -> None:
|
|||||||
assert state is State.RUNNING
|
assert state is State.RUNNING
|
||||||
assert log_has('Changing state to: RUNNING', caplog.record_tuples)
|
assert log_has('Changing state to: RUNNING', caplog.record_tuples)
|
||||||
assert mock_throttle.call_count == 1
|
assert mock_throttle.call_count == 1
|
||||||
|
# Check strategy is loaded, and received a dataprovider object
|
||||||
|
assert freqtrade.strategy
|
||||||
|
assert freqtrade.strategy.dp
|
||||||
|
assert isinstance(freqtrade.strategy.dp, DataProvider)
|
||||||
|
|
||||||
|
|
||||||
def test_worker_stopped(mocker, default_conf, caplog) -> None:
|
def test_worker_stopped(mocker, default_conf, caplog) -> None:
|
||||||
|
Loading…
Reference in New Issue
Block a user