mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 18:23:55 +00:00
Fix tests - freqtrade should not be patched in this case
This commit is contained in:
parent
d5254dff7b
commit
a87fc5f863
|
@ -112,9 +112,9 @@ def test_worker_running(mocker, default_conf, caplog) -> None:
|
||||||
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
|
# Check strategy is loaded, and received a dataprovider object
|
||||||
assert freqtrade.strategy
|
assert worker.freqtrade.strategy
|
||||||
assert freqtrade.strategy.dp
|
assert worker.freqtrade.strategy.dp
|
||||||
assert isinstance(freqtrade.strategy.dp, DataProvider)
|
assert isinstance(worker.freqtrade.strategy.dp, DataProvider)
|
||||||
|
|
||||||
|
|
||||||
def test_worker_stopped(mocker, default_conf, caplog) -> None:
|
def test_worker_stopped(mocker, default_conf, caplog) -> None:
|
||||||
|
@ -710,7 +710,7 @@ def test_process_exchange_failures(default_conf, ticker, markets, mocker) -> Non
|
||||||
)
|
)
|
||||||
sleep_mock = mocker.patch('time.sleep', side_effect=lambda _: None)
|
sleep_mock = mocker.patch('time.sleep', side_effect=lambda _: None)
|
||||||
|
|
||||||
worker = get_patched_worker(mocker, default_conf)
|
worker = Worker(args=None, config=default_conf)
|
||||||
patch_get_signal(worker.freqtrade)
|
patch_get_signal(worker.freqtrade)
|
||||||
|
|
||||||
result = worker._process()
|
result = worker._process()
|
||||||
|
@ -727,7 +727,7 @@ def test_process_operational_exception(default_conf, ticker, markets, mocker) ->
|
||||||
markets=PropertyMock(return_value=markets),
|
markets=PropertyMock(return_value=markets),
|
||||||
buy=MagicMock(side_effect=OperationalException)
|
buy=MagicMock(side_effect=OperationalException)
|
||||||
)
|
)
|
||||||
worker = get_patched_worker(mocker, default_conf)
|
worker = Worker(args=None, config=default_conf)
|
||||||
patch_get_signal(worker.freqtrade)
|
patch_get_signal(worker.freqtrade)
|
||||||
|
|
||||||
assert worker.state == State.RUNNING
|
assert worker.state == State.RUNNING
|
||||||
|
|
Loading…
Reference in New Issue
Block a user