update setup_utils_configuration to not force-set dry-run mode
This commit is contained in:
@@ -10,7 +10,8 @@ from .configuration import Configuration
|
|||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
def setup_utils_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str, Any]:
|
def setup_utils_configuration(
|
||||||
|
args: Dict[str, Any], method: RunMode, *, set_dry: bool = True) -> Dict[str, Any]:
|
||||||
"""
|
"""
|
||||||
Prepare the configuration for utils subcommands
|
Prepare the configuration for utils subcommands
|
||||||
:param args: Cli args from Arguments()
|
:param args: Cli args from Arguments()
|
||||||
@@ -21,7 +22,8 @@ def setup_utils_configuration(args: Dict[str, Any], method: RunMode) -> Dict[str
|
|||||||
config = configuration.get_config()
|
config = configuration.get_config()
|
||||||
|
|
||||||
# Ensure these modes are using Dry-run
|
# Ensure these modes are using Dry-run
|
||||||
config['dry_run'] = True
|
if set_dry:
|
||||||
|
config['dry_run'] = True
|
||||||
validate_config_consistency(config, preliminary=True)
|
validate_config_consistency(config, preliminary=True)
|
||||||
|
|
||||||
return config
|
return config
|
||||||
|
|||||||
@@ -39,6 +39,10 @@ def test_setup_utils_configuration():
|
|||||||
assert "exchange" in config
|
assert "exchange" in config
|
||||||
assert config['dry_run'] is True
|
assert config['dry_run'] is True
|
||||||
|
|
||||||
|
config = setup_utils_configuration(get_args(args), RunMode.OTHER, set_dry=False)
|
||||||
|
assert "exchange" in config
|
||||||
|
assert config['dry_run'] is False
|
||||||
|
|
||||||
|
|
||||||
def test_start_trading_fail(mocker, caplog):
|
def test_start_trading_fail(mocker, caplog):
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user