Small adjustments for moved commands

This commit is contained in:
Matthias
2020-01-26 13:33:13 +01:00
parent e033df6a2f
commit f347e5934a
7 changed files with 36 additions and 28 deletions

View File

@@ -12,13 +12,13 @@ from arrow import Arrow
from freqtrade import constants
from freqtrade.configuration import TimeRange
from freqtrade.commands.optimize_commands import setup_optimize_configuration, start_backtesting
from freqtrade.data import history
from freqtrade.data.btanalysis import evaluate_result_multi
from freqtrade.data.converter import parse_ticker_dataframe
from freqtrade.data.dataprovider import DataProvider
from freqtrade.data.history import get_timerange
from freqtrade.exceptions import DependencyException, OperationalException
from freqtrade.optimize import setup_configuration, start_backtesting
from freqtrade.optimize.backtesting import Backtesting
from freqtrade.state import RunMode
from freqtrade.strategy.default_strategy import DefaultStrategy
@@ -177,7 +177,7 @@ def _trend_alternate(dataframe=None, metadata=None):
# Unit tests
def test_setup_configuration_without_arguments(mocker, default_conf, caplog) -> None:
def test_setup_optimize_configuration_without_arguments(mocker, default_conf, caplog) -> None:
patched_configuration_load_config_file(mocker, default_conf)
args = [
@@ -186,7 +186,7 @@ def test_setup_configuration_without_arguments(mocker, default_conf, caplog) ->
'--strategy', 'DefaultStrategy',
]
config = setup_configuration(get_args(args), RunMode.BACKTEST)
config = setup_optimize_configuration(get_args(args), RunMode.BACKTEST)
assert 'max_open_trades' in config
assert 'stake_currency' in config
assert 'stake_amount' in config
@@ -227,7 +227,7 @@ def test_setup_bt_configuration_with_arguments(mocker, default_conf, caplog) ->
'--fee', '0',
]
config = setup_configuration(get_args(args), RunMode.BACKTEST)
config = setup_optimize_configuration(get_args(args), RunMode.BACKTEST)
assert 'max_open_trades' in config
assert 'stake_currency' in config
assert 'stake_amount' in config
@@ -260,7 +260,7 @@ def test_setup_bt_configuration_with_arguments(mocker, default_conf, caplog) ->
assert log_has('Parameter --fee detected, setting fee to: {} ...'.format(config['fee']), caplog)
def test_setup_configuration_unlimited_stake_amount(mocker, default_conf, caplog) -> None:
def test_setup_optimize_configuration_unlimited_stake_amount(mocker, default_conf, caplog) -> None:
default_conf['stake_amount'] = constants.UNLIMITED_STAKE_AMOUNT
patched_configuration_load_config_file(mocker, default_conf)
@@ -272,7 +272,7 @@ def test_setup_configuration_unlimited_stake_amount(mocker, default_conf, caplog
]
with pytest.raises(DependencyException, match=r'.*stake amount.*'):
setup_configuration(get_args(args), RunMode.BACKTEST)
setup_optimize_configuration(get_args(args), RunMode.BACKTEST)
def test_start(mocker, fee, default_conf, caplog) -> None:

View File

@@ -3,14 +3,14 @@
from unittest.mock import MagicMock
from freqtrade.optimize import setup_configuration, start_edge
from freqtrade.commands.optimize_commands import setup_optimize_configuration, start_edge
from freqtrade.optimize.edge_cli import EdgeCli
from freqtrade.state import RunMode
from tests.conftest import (get_args, log_has, log_has_re, patch_exchange,
patched_configuration_load_config_file)
def test_setup_configuration_without_arguments(mocker, default_conf, caplog) -> None:
def test_setup_optimize_configuration_without_arguments(mocker, default_conf, caplog) -> None:
patched_configuration_load_config_file(mocker, default_conf)
args = [
@@ -19,7 +19,7 @@ def test_setup_configuration_without_arguments(mocker, default_conf, caplog) ->
'--strategy', 'DefaultStrategy',
]
config = setup_configuration(get_args(args), RunMode.EDGE)
config = setup_optimize_configuration(get_args(args), RunMode.EDGE)
assert config['runmode'] == RunMode.EDGE
assert 'max_open_trades' in config
@@ -53,7 +53,7 @@ def test_setup_edge_configuration_with_arguments(mocker, edge_conf, caplog) -> N
'--stoplosses=-0.01,-0.10,-0.001'
]
config = setup_configuration(get_args(args), RunMode.EDGE)
config = setup_optimize_configuration(get_args(args), RunMode.EDGE)
assert 'max_open_trades' in config
assert 'stake_currency' in config
assert 'stake_amount' in config

View File

@@ -9,10 +9,10 @@ import pytest
from arrow import Arrow
from filelock import Timeout
from freqtrade.exceptions import OperationalException
from freqtrade.commands.optimize_commands import setup_optimize_configuration, start_hyperopt
from freqtrade.data.converter import parse_ticker_dataframe
from freqtrade.data.history import load_tickerdata_file
from freqtrade.optimize import setup_configuration, start_hyperopt
from freqtrade.exceptions import OperationalException
from freqtrade.optimize.default_hyperopt import DefaultHyperOpt
from freqtrade.optimize.default_hyperopt_loss import DefaultHyperOptLoss
from freqtrade.optimize.hyperopt import Hyperopt
@@ -77,7 +77,7 @@ def test_setup_hyperopt_configuration_without_arguments(mocker, default_conf, ca
'--hyperopt', 'DefaultHyperOpt',
]
config = setup_configuration(get_args(args), RunMode.HYPEROPT)
config = setup_optimize_configuration(get_args(args), RunMode.HYPEROPT)
assert 'max_open_trades' in config
assert 'stake_currency' in config
assert 'stake_amount' in config
@@ -117,7 +117,7 @@ def test_setup_hyperopt_configuration_with_arguments(mocker, default_conf, caplo
'--print-all'
]
config = setup_configuration(get_args(args), RunMode.HYPEROPT)
config = setup_optimize_configuration(get_args(args), RunMode.HYPEROPT)
assert 'max_open_trades' in config
assert 'stake_currency' in config
assert 'stake_amount' in config