Add tests for ohlcv_get_available_data

This commit is contained in:
Matthias
2020-07-12 09:56:46 +02:00
parent 422825ea1b
commit d4fc52d2d5
2 changed files with 17 additions and 2 deletions

View File

@@ -29,9 +29,10 @@ class JsonDataHandler(IDataHandler):
:param datadir: Directory to search for ohlcv files
:return: List of Pair
"""
_tmp = [re.search(r'^([a-zA-Z_]+)\-(\S+)(?=.json)', p.name)
_tmp = [re.search(r'^([a-zA-Z_]+)\-(\d+\S+)(?=.json)', p.name)
for p in datadir.glob(f"*.{cls._get_file_extension()}")]
return [(match[1].replace('_', '/'), match[2]) for match in _tmp if len(match.groups()) > 1]
return [(match[1].replace('_', '/'), match[2]) for match in _tmp
if match and len(match.groups()) > 1]
@classmethod
def ohlcv_get_pairs(cls, datadir: Path, timeframe: str) -> List[str]: