Adjust imports

This commit is contained in:
Matthias 2020-01-26 10:55:39 +01:00
parent 80ed1c3e14
commit 6e85280467
5 changed files with 29 additions and 23 deletions

View File

@ -0,0 +1,6 @@
from .utils import (setup_utils_configuration, start_create_userdir, # noqa: F401
start_download_data, start_hyperopt_list,
start_hyperopt_show, start_list_exchanges,
start_list_markets, start_list_strategies,
start_list_timeframes, start_new_hyperopt,
start_new_strategy, start_test_pairlist, start_trading)

View File

@ -131,12 +131,12 @@ class Arguments:
self._build_args(optionlist=['version'], parser=self.parser)
from freqtrade.optimize import start_backtesting, start_hyperopt, start_edge
from freqtrade.utils import (start_create_userdir, start_download_data,
start_hyperopt_list, start_hyperopt_show,
start_list_exchanges, start_list_markets,
start_list_strategies, start_new_hyperopt,
start_new_strategy, start_list_timeframes,
start_test_pairlist, start_trading)
from freqtrade.commands import (start_create_userdir, start_download_data,
start_hyperopt_list, start_hyperopt_show,
start_list_exchanges, start_list_markets,
start_list_strategies, start_new_hyperopt,
start_new_strategy, start_list_timeframes,
start_test_pairlist, start_trading)
from freqtrade.plot.plot_utils import start_plot_dataframe, start_plot_profit
subparsers = self.parser.add_subparsers(dest='command',

View File

@ -4,7 +4,7 @@ from typing import Any, Dict
from freqtrade import constants
from freqtrade.exceptions import DependencyException, OperationalException
from freqtrade.state import RunMode
from freqtrade.utils import setup_utils_configuration
from freqtrade.commands import setup_utils_configuration
logger = logging.getLogger(__name__)

View File

@ -2,7 +2,7 @@ from typing import Any, Dict
from freqtrade.exceptions import OperationalException
from freqtrade.state import RunMode
from freqtrade.utils import setup_utils_configuration
from freqtrade.commands import setup_utils_configuration
def validate_plot_args(args: Dict[str, Any]):

View File

@ -4,15 +4,15 @@ from unittest.mock import MagicMock, PropertyMock
import pytest
from freqtrade.commands import (setup_utils_configuration,
start_create_userdir, start_download_data,
start_hyperopt_list, start_hyperopt_show,
start_list_exchanges, start_list_markets,
start_list_strategies, start_list_timeframes,
start_new_hyperopt, start_new_strategy,
start_test_pairlist, start_trading)
from freqtrade.exceptions import OperationalException
from freqtrade.state import RunMode
from freqtrade.utils import (setup_utils_configuration, start_create_userdir,
start_download_data, start_hyperopt_list,
start_hyperopt_show, start_list_exchanges,
start_list_markets, start_list_strategies,
start_list_timeframes, start_new_hyperopt,
start_new_strategy, start_test_pairlist,
start_trading)
from tests.conftest import (get_args, log_has, log_has_re, patch_exchange,
patched_configuration_load_config_file)
@ -451,8 +451,8 @@ def test_create_datadir(caplog, mocker):
# Added assert here to analyze random test-failures ...
assert len(caplog.record_tuples) == 0
cud = mocker.patch("freqtrade.utils.create_userdata_dir", MagicMock())
csf = mocker.patch("freqtrade.utils.copy_sample_files", MagicMock())
cud = mocker.patch("freqtrade.commands.create_userdata_dir", MagicMock())
csf = mocker.patch("freqtrade.commands.copy_sample_files", MagicMock())
args = [
"create-userdir",
"--userdir",
@ -538,7 +538,7 @@ def test_start_new_hyperopt_no_arg(mocker, caplog):
def test_download_data_keyboardInterrupt(mocker, caplog, markets):
dl_mock = mocker.patch('freqtrade.utils.refresh_backtest_ohlcv_data',
dl_mock = mocker.patch('freqtrade.commands.refresh_backtest_ohlcv_data',
MagicMock(side_effect=KeyboardInterrupt))
patch_exchange(mocker)
mocker.patch(
@ -556,7 +556,7 @@ def test_download_data_keyboardInterrupt(mocker, caplog, markets):
def test_download_data_no_markets(mocker, caplog):
dl_mock = mocker.patch('freqtrade.utils.refresh_backtest_ohlcv_data',
dl_mock = mocker.patch('freqtrade.commands.refresh_backtest_ohlcv_data',
MagicMock(return_value=["ETH/BTC", "XRP/BTC"]))
patch_exchange(mocker, id='binance')
mocker.patch(
@ -574,7 +574,7 @@ def test_download_data_no_markets(mocker, caplog):
def test_download_data_no_exchange(mocker, caplog):
mocker.patch('freqtrade.utils.refresh_backtest_ohlcv_data',
mocker.patch('freqtrade.commands.refresh_backtest_ohlcv_data',
MagicMock(return_value=["ETH/BTC", "XRP/BTC"]))
patch_exchange(mocker)
mocker.patch(
@ -594,7 +594,7 @@ def test_download_data_no_pairs(mocker, caplog):
mocker.patch.object(Path, "exists", MagicMock(return_value=False))
mocker.patch('freqtrade.utils.refresh_backtest_ohlcv_data',
mocker.patch('freqtrade.commands.refresh_backtest_ohlcv_data',
MagicMock(return_value=["ETH/BTC", "XRP/BTC"]))
patch_exchange(mocker)
mocker.patch(
@ -613,9 +613,9 @@ def test_download_data_no_pairs(mocker, caplog):
def test_download_data_trades(mocker, caplog):
dl_mock = mocker.patch('freqtrade.utils.refresh_backtest_trades_data',
dl_mock = mocker.patch('freqtrade.commands.refresh_backtest_trades_data',
MagicMock(return_value=[]))
convert_mock = mocker.patch('freqtrade.utils.convert_trades_to_ohlcv',
convert_mock = mocker.patch('freqtrade.commands.convert_trades_to_ohlcv',
MagicMock(return_value=[]))
patch_exchange(mocker)
mocker.patch(