renaming of make_testdata_path reverted

This commit is contained in:
hroff-1902 2019-05-22 14:04:58 +03:00
parent 7cb753754b
commit 98eeec3145
3 changed files with 6 additions and 6 deletions

View File

@ -138,13 +138,13 @@ def load_data(datadir: Optional[Path],
return result
def make_datadir_path(datadir: Optional[Path]) -> Path:
def make_testdata_path(datadir: Optional[Path]) -> Path:
"""Return the path where testdata files are stored"""
return datadir or (Path(__file__).parent.parent / "tests" / "testdata").resolve()
def pair_data_filename(datadir: Optional[Path], pair: str, ticker_interval: str) -> Path:
path = make_datadir_path(datadir)
path = make_testdata_path(datadir)
pair_s = pair.replace("/", "_")
filename = path.joinpath(f'{pair_s}-{ticker_interval}.json')
return filename

View File

@ -2,12 +2,12 @@ import pytest
from pandas import DataFrame
from freqtrade.data.btanalysis import BT_DATA_COLUMNS, load_backtest_data
from freqtrade.data.history import make_datadir_path
from freqtrade.data.history import make_testdata_path
def test_load_backtest_data():
filename = make_datadir_path(None) / "backtest-result_test.json"
filename = make_testdata_path(None) / "backtest-result_test.json"
bt_data = load_backtest_data(filename)
assert isinstance(bt_data, DataFrame)
assert list(bt_data.columns) == BT_DATA_COLUMNS + ["profitabs"]

View File

@ -16,7 +16,7 @@ from freqtrade.data import history
from freqtrade.data.history import (download_pair_history,
load_cached_data_for_updating,
load_tickerdata_file,
make_datadir_path,
make_testdata_path,
trim_tickerlist)
from freqtrade.misc import file_dump_json
from freqtrade.tests.conftest import get_patched_exchange, log_has
@ -136,7 +136,7 @@ def test_load_data_with_new_pair_1min(ticker_history_list, mocker, caplog, defau
def test_testdata_path() -> None:
assert str(Path('freqtrade') / 'tests' / 'testdata') in str(make_datadir_path(None))
assert str(Path('freqtrade') / 'tests' / 'testdata') in str(make_testdata_path(None))
def test_load_cached_data_for_updating(mocker) -> None: