Adapt some tests
This commit is contained in:
parent
05deb9e09b
commit
8655e521d7
@ -4,7 +4,7 @@ import argparse
|
|||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
from freqtrade.configuration import Arguments
|
from freqtrade.configuration import Arguments
|
||||||
from freqtrade.configuration.arguments import ARGS_DOWNLOADER, ARGS_PLOT_DATAFRAME
|
from freqtrade.configuration.arguments import ARGS_PLOT_DATAFRAME
|
||||||
from freqtrade.configuration.cli_options import check_int_positive
|
from freqtrade.configuration.cli_options import check_int_positive
|
||||||
|
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# pragma pylint: disable=missing-docstring
|
# pragma pylint: disable=missing-docstring
|
||||||
|
|
||||||
from copy import deepcopy
|
from copy import deepcopy
|
||||||
from unittest.mock import MagicMock
|
from unittest.mock import MagicMock, PropertyMock
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
@ -21,6 +21,7 @@ def test_parse_args_backtesting(mocker) -> None:
|
|||||||
further argument parsing is done in test_arguments.py
|
further argument parsing is done in test_arguments.py
|
||||||
"""
|
"""
|
||||||
backtesting_mock = mocker.patch('freqtrade.optimize.start_backtesting', MagicMock())
|
backtesting_mock = mocker.patch('freqtrade.optimize.start_backtesting', MagicMock())
|
||||||
|
backtesting_mock.__name__ = PropertyMock("start_backtesting")
|
||||||
# it's sys.exit(0) at the end of backtesting
|
# it's sys.exit(0) at the end of backtesting
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
main(['backtesting'])
|
main(['backtesting'])
|
||||||
@ -36,6 +37,7 @@ def test_parse_args_backtesting(mocker) -> None:
|
|||||||
|
|
||||||
def test_main_start_hyperopt(mocker) -> None:
|
def test_main_start_hyperopt(mocker) -> None:
|
||||||
hyperopt_mock = mocker.patch('freqtrade.optimize.start_hyperopt', MagicMock())
|
hyperopt_mock = mocker.patch('freqtrade.optimize.start_hyperopt', MagicMock())
|
||||||
|
hyperopt_mock.__name__ = PropertyMock("start_hyperopt")
|
||||||
# it's sys.exit(0) at the end of hyperopt
|
# it's sys.exit(0) at the end of hyperopt
|
||||||
with pytest.raises(SystemExit):
|
with pytest.raises(SystemExit):
|
||||||
main(['hyperopt'])
|
main(['hyperopt'])
|
||||||
|
@ -50,7 +50,7 @@ def test_init_plotscript(default_conf, mocker):
|
|||||||
assert "pairs" in ret
|
assert "pairs" in ret
|
||||||
assert "strategy" in ret
|
assert "strategy" in ret
|
||||||
|
|
||||||
default_conf['pairs'] = "POWR/BTC,XLM/BTC"
|
default_conf['pairs'] = ["POWR/BTC", "XLM/BTC"]
|
||||||
ret = init_plotscript(default_conf)
|
ret = init_plotscript(default_conf)
|
||||||
assert "tickers" in ret
|
assert "tickers" in ret
|
||||||
assert "POWR/BTC" in ret["tickers"]
|
assert "POWR/BTC" in ret["tickers"]
|
||||||
|
Loading…
Reference in New Issue
Block a user