Remove unused test code
This commit is contained in:
parent
4d45eb0644
commit
60cf52aa34
@ -16,7 +16,7 @@ from telegram import Chat, Message, Update
|
|||||||
from freqtrade import constants
|
from freqtrade import constants
|
||||||
from freqtrade.commands import Arguments
|
from freqtrade.commands import Arguments
|
||||||
from freqtrade.data.converter import ohlcv_to_dataframe
|
from freqtrade.data.converter import ohlcv_to_dataframe
|
||||||
from freqtrade.edge import Edge, PairInfo
|
from freqtrade.edge import PairInfo
|
||||||
from freqtrade.enums import RunMode
|
from freqtrade.enums import RunMode
|
||||||
from freqtrade.exchange import Exchange
|
from freqtrade.exchange import Exchange
|
||||||
from freqtrade.freqtradebot import FreqtradeBot
|
from freqtrade.freqtradebot import FreqtradeBot
|
||||||
@ -140,11 +140,6 @@ def patch_edge(mocker) -> None:
|
|||||||
mocker.patch('freqtrade.edge.Edge.calculate', MagicMock(return_value=True))
|
mocker.patch('freqtrade.edge.Edge.calculate', MagicMock(return_value=True))
|
||||||
|
|
||||||
|
|
||||||
def get_patched_edge(mocker, config) -> Edge:
|
|
||||||
patch_edge(mocker)
|
|
||||||
edge = Edge(config)
|
|
||||||
return edge
|
|
||||||
|
|
||||||
# Functions for recurrent object patching
|
# Functions for recurrent object patching
|
||||||
|
|
||||||
|
|
||||||
|
@ -2017,15 +2017,6 @@ def test_get_sell_rate_exception(default_conf, mocker, caplog):
|
|||||||
assert exchange.get_rate(pair, refresh=True, side="sell") == 0.13
|
assert exchange.get_rate(pair, refresh=True, side="sell") == 0.13
|
||||||
|
|
||||||
|
|
||||||
def make_fetch_ohlcv_mock(data):
|
|
||||||
def fetch_ohlcv_mock(pair, timeframe, since):
|
|
||||||
if since:
|
|
||||||
assert since > data[-1][0]
|
|
||||||
return []
|
|
||||||
return data
|
|
||||||
return fetch_ohlcv_mock
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize("exchange_name", EXCHANGES)
|
@pytest.mark.parametrize("exchange_name", EXCHANGES)
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test___async_get_candle_history_sort(default_conf, mocker, exchange_name):
|
async def test___async_get_candle_history_sort(default_conf, mocker, exchange_name):
|
||||||
|
@ -170,12 +170,8 @@ def test_edge_called_in_process(mocker, edge_conf) -> None:
|
|||||||
patch_RPCManager(mocker)
|
patch_RPCManager(mocker)
|
||||||
patch_edge(mocker)
|
patch_edge(mocker)
|
||||||
|
|
||||||
def _refresh_whitelist(list):
|
|
||||||
return ['ETH/USDT', 'LTC/BTC', 'XRP/BTC', 'NEO/BTC']
|
|
||||||
|
|
||||||
patch_exchange(mocker)
|
patch_exchange(mocker)
|
||||||
freqtrade = FreqtradeBot(edge_conf)
|
freqtrade = FreqtradeBot(edge_conf)
|
||||||
freqtrade.pairlists._validate_whitelist = _refresh_whitelist
|
|
||||||
patch_get_signal(freqtrade)
|
patch_get_signal(freqtrade)
|
||||||
freqtrade.process()
|
freqtrade.process()
|
||||||
assert freqtrade.active_pair_whitelist == ['NEO/BTC', 'LTC/BTC']
|
assert freqtrade.active_pair_whitelist == ['NEO/BTC', 'LTC/BTC']
|
||||||
@ -664,9 +660,6 @@ def test_process_informative_pairs_added(default_conf_usdt, ticker_usdt, mocker)
|
|||||||
patch_RPCManager(mocker)
|
patch_RPCManager(mocker)
|
||||||
patch_exchange(mocker)
|
patch_exchange(mocker)
|
||||||
|
|
||||||
def _refresh_whitelist(list):
|
|
||||||
return ['ETH/USDT', 'LTC/BTC', 'XRP/BTC', 'NEO/BTC']
|
|
||||||
|
|
||||||
refresh_mock = MagicMock()
|
refresh_mock = MagicMock()
|
||||||
mocker.patch.multiple(
|
mocker.patch.multiple(
|
||||||
'freqtrade.exchange.Exchange',
|
'freqtrade.exchange.Exchange',
|
||||||
@ -682,7 +675,6 @@ def test_process_informative_pairs_added(default_conf_usdt, ticker_usdt, mocker)
|
|||||||
mocker.patch('time.sleep', return_value=None)
|
mocker.patch('time.sleep', return_value=None)
|
||||||
|
|
||||||
freqtrade = FreqtradeBot(default_conf_usdt)
|
freqtrade = FreqtradeBot(default_conf_usdt)
|
||||||
freqtrade.pairlists._validate_whitelist = _refresh_whitelist
|
|
||||||
freqtrade.strategy.informative_pairs = inf_pairs
|
freqtrade.strategy.informative_pairs = inf_pairs
|
||||||
# patch_get_signal(freqtrade)
|
# patch_get_signal(freqtrade)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user