mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-11-29 08:33:07 +00:00
Properly default to user_data/config.json if it exists
This commit is contained in:
@@ -5,8 +5,9 @@ from unittest.mock import MagicMock, PropertyMock
|
||||
|
||||
import pytest
|
||||
|
||||
from pathlib import Path
|
||||
from freqtrade.commands import Arguments
|
||||
from freqtrade.exceptions import OperationalException, FreqtradeException
|
||||
from freqtrade.exceptions import FreqtradeException, OperationalException
|
||||
from freqtrade.freqtradebot import FreqtradeBot
|
||||
from freqtrade.main import main
|
||||
from freqtrade.state import State
|
||||
@@ -26,6 +27,7 @@ def test_parse_args_backtesting(mocker) -> None:
|
||||
Test that main() can start backtesting and also ensure we can pass some specific arguments
|
||||
further argument parsing is done in test_arguments.py
|
||||
"""
|
||||
mocker.patch.object(Path, "is_file", MagicMock(side_effect=[False, True]))
|
||||
backtesting_mock = mocker.patch('freqtrade.commands.start_backtesting')
|
||||
backtesting_mock.__name__ = PropertyMock("start_backtesting")
|
||||
# it's sys.exit(0) at the end of backtesting
|
||||
@@ -42,6 +44,7 @@ def test_parse_args_backtesting(mocker) -> None:
|
||||
|
||||
|
||||
def test_main_start_hyperopt(mocker) -> None:
|
||||
mocker.patch.object(Path, "is_file", MagicMock(side_effect=[False, True]))
|
||||
hyperopt_mock = mocker.patch('freqtrade.commands.start_hyperopt', MagicMock())
|
||||
hyperopt_mock.__name__ = PropertyMock("start_hyperopt")
|
||||
# it's sys.exit(0) at the end of hyperopt
|
||||
|
||||
Reference in New Issue
Block a user