FIx futures trades pair download directory
This commit is contained in:
@@ -266,6 +266,11 @@ class IDataHandler(ABC):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def _pair_trades_filename(cls, datadir: Path, pair: str) -> Path:
|
def _pair_trades_filename(cls, datadir: Path, pair: str) -> Path:
|
||||||
pair_s = misc.pair_to_filename(pair)
|
pair_s = misc.pair_to_filename(pair)
|
||||||
|
if ':' in pair:
|
||||||
|
# Futures pair ...
|
||||||
|
# TODO: this should not rely on ";" in the pairname.
|
||||||
|
datadir = datadir.joinpath('futures')
|
||||||
|
|
||||||
filename = datadir.joinpath(f'{pair_s}-trades.{cls._get_file_extension()}')
|
filename = datadir.joinpath(f'{pair_s}-trades.{cls._get_file_extension()}')
|
||||||
return filename
|
return filename
|
||||||
|
|
||||||
|
|||||||
@@ -820,11 +820,6 @@ def test_download_data_trades(mocker):
|
|||||||
"--trading-mode", "futures",
|
"--trading-mode", "futures",
|
||||||
"--dl-trades"
|
"--dl-trades"
|
||||||
]
|
]
|
||||||
with pytest.raises(OperationalException,
|
|
||||||
match="Trade download not supported for futures."):
|
|
||||||
pargs = get_args(args)
|
|
||||||
pargs['config'] = None
|
|
||||||
start_download_data(pargs)
|
|
||||||
|
|
||||||
|
|
||||||
def test_download_data_data_invalid(mocker):
|
def test_download_data_data_invalid(mocker):
|
||||||
|
|||||||
@@ -78,10 +78,6 @@ def test_download_data_main_trades(mocker):
|
|||||||
"trading_mode": "futures",
|
"trading_mode": "futures",
|
||||||
})
|
})
|
||||||
|
|
||||||
with pytest.raises(OperationalException,
|
|
||||||
match="Trade download not supported for futures."):
|
|
||||||
download_data_main(config)
|
|
||||||
|
|
||||||
|
|
||||||
def test_download_data_main_data_invalid(mocker):
|
def test_download_data_main_data_invalid(mocker):
|
||||||
patch_exchange(mocker, id="kraken")
|
patch_exchange(mocker, id="kraken")
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ def test_json_pair_data_filename(pair, timeframe, expected_result, candle_type):
|
|||||||
|
|
||||||
@pytest.mark.parametrize("pair,expected_result", [
|
@pytest.mark.parametrize("pair,expected_result", [
|
||||||
("ETH/BTC", 'freqtrade/hello/world/ETH_BTC-trades.json'),
|
("ETH/BTC", 'freqtrade/hello/world/ETH_BTC-trades.json'),
|
||||||
|
("ETH/USDT:USDT", 'freqtrade/hello/world/futures/ETH_USDT_USDT-trades.json'),
|
||||||
("Fabric Token/ETH", 'freqtrade/hello/world/Fabric_Token_ETH-trades.json'),
|
("Fabric Token/ETH", 'freqtrade/hello/world/Fabric_Token_ETH-trades.json'),
|
||||||
("ETHH20", 'freqtrade/hello/world/ETHH20-trades.json'),
|
("ETHH20", 'freqtrade/hello/world/ETHH20-trades.json'),
|
||||||
(".XBTBON2H", 'freqtrade/hello/world/_XBTBON2H-trades.json'),
|
(".XBTBON2H", 'freqtrade/hello/world/_XBTBON2H-trades.json'),
|
||||||
|
|||||||
Reference in New Issue
Block a user