mirror of
https://github.com/freqtrade/freqtrade.git
synced 2024-11-10 10:21:59 +00:00
Add log_has_re
This commit is contained in:
parent
02c3552954
commit
40fea4593f
|
@ -1,6 +1,7 @@
|
|||
# pragma pylint: disable=missing-docstring
|
||||
import json
|
||||
import logging
|
||||
import re
|
||||
from datetime import datetime
|
||||
from functools import reduce
|
||||
from typing import Dict, Optional
|
||||
|
@ -27,6 +28,12 @@ def log_has(line, logs):
|
|||
False)
|
||||
|
||||
|
||||
def log_has_re(line, logs):
|
||||
return reduce(lambda a, b: a or b,
|
||||
filter(lambda x: re.match(line, x[2]), logs),
|
||||
False)
|
||||
|
||||
|
||||
def patch_exchange(mocker, api_mock=None, id='bittrex') -> None:
|
||||
mocker.patch('freqtrade.exchange.Exchange._load_markets', MagicMock(return_value={}))
|
||||
mocker.patch('freqtrade.exchange.Exchange.validate_timeframes', MagicMock())
|
||||
|
|
Loading…
Reference in New Issue
Block a user