FIx futures trades pair download directory

This commit is contained in:
Matthias
2024-03-01 20:17:43 +01:00
parent 5dee60921f
commit bdd63aa1d6
4 changed files with 6 additions and 9 deletions

View File

@@ -266,6 +266,11 @@ class IDataHandler(ABC):
@classmethod
def _pair_trades_filename(cls, datadir: Path, pair: str) -> Path:
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()}')
return filename

View File

@@ -820,11 +820,6 @@ def test_download_data_trades(mocker):
"--trading-mode", "futures",
"--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):

View File

@@ -78,10 +78,6 @@ def test_download_data_main_trades(mocker):
"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):
patch_exchange(mocker, id="kraken")

View File

@@ -170,6 +170,7 @@ def test_json_pair_data_filename(pair, timeframe, expected_result, candle_type):
@pytest.mark.parametrize("pair,expected_result", [
("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'),
("ETHH20", 'freqtrade/hello/world/ETHH20-trades.json'),
(".XBTBON2H", 'freqtrade/hello/world/_XBTBON2H-trades.json'),