Merge pull request #5071 from janoskut/plot-profit-make-open-html-optional
plot-profit: Make "auto-open" HTML result optional
This commit is contained in:
@@ -186,18 +186,22 @@ def test_plot_dataframe_options() -> None:
|
||||
assert pargs['pairs'] == ['UNITTEST/BTC']
|
||||
|
||||
|
||||
def test_plot_profit_options() -> None:
|
||||
@pytest.mark.parametrize('auto_open_arg', [True, False])
|
||||
def test_plot_profit_options(auto_open_arg: bool) -> None:
|
||||
args = [
|
||||
'plot-profit',
|
||||
'-p', 'UNITTEST/BTC',
|
||||
'--trade-source', 'DB',
|
||||
'--db-url', 'sqlite:///whatever.sqlite',
|
||||
]
|
||||
if auto_open_arg:
|
||||
args.append('--auto-open')
|
||||
pargs = Arguments(args).get_parsed_arg()
|
||||
|
||||
assert pargs['trade_source'] == 'DB'
|
||||
assert pargs['pairs'] == ['UNITTEST/BTC']
|
||||
assert pargs['db_url'] == 'sqlite:///whatever.sqlite'
|
||||
assert pargs['plot_auto_open'] == auto_open_arg
|
||||
|
||||
|
||||
def test_config_notallowed(mocker) -> None:
|
||||
|
@@ -460,7 +460,7 @@ def test_plot_profit(default_conf, mocker, testdatadir):
|
||||
assert store_mock.call_count == 1
|
||||
|
||||
assert profit_mock.call_args_list[0][0][0] == default_conf['pairs']
|
||||
assert store_mock.call_args_list[0][1]['auto_open'] is True
|
||||
assert store_mock.call_args_list[0][1]['auto_open'] is False
|
||||
|
||||
|
||||
@pytest.mark.parametrize("ind1,ind2,plot_conf,exp", [
|
||||
|
Reference in New Issue
Block a user