small refactor splitting the _process()

This commit is contained in:
kryofly
2018-01-10 09:09:33 +01:00
parent ad2328bbd8
commit f8cc08e2a1
4 changed files with 88 additions and 38 deletions

View File

@@ -1,6 +1,7 @@
# pragma pylint: disable=missing-docstring
from datetime import datetime
from unittest.mock import MagicMock
from functools import reduce
import pytest
import arrow
@@ -10,6 +11,14 @@ from telegram import Message, Chat, Update
from freqtrade.misc import CONF_SCHEMA
def log_has(line, logs):
# caplog mocker returns log as a tuple: ('freqtrade.analyze', logging.WARNING, 'foobar')
# and we want to match line against foobar in the tuple
return reduce(lambda a, b: a or b,
filter(lambda x: x[2] == line, logs),
False)
@pytest.fixture(scope="module")
def default_conf():
""" Returns validated configuration suitable for most tests """