def test_start_plot_profit_error(mocker):

    args = ["plot-profit", "--pairs", "ETH/BTC"]
    argsp = get_args(args)
    # Make sure we use no config. Details: #2241
    # not resetting config causes random failures if config.json exists
    argsp["config"] = []
    with pytest.raises(OperationalException):
        start_plot_profit(argsp)
def test_start_plot_profit(mocker):
    aup = mocker.patch("freqtrade.plot.plotting.plot_profit", MagicMock())
    args = [
        "--config", "config.json.example", "plot-profit", "--pairs", "ETH/BTC"
    ]
    start_plot_profit(get_args(args))

    assert aup.call_count == 1
    called_config = aup.call_args_list[0][0][0]
    assert "pairs" in called_config
    assert called_config['pairs'] == ["ETH/BTC"]
def test_start_plot_profit_error(mocker):
    args = ["plot-profit", "--pairs", "ETH/BTC"]
    with pytest.raises(OperationalException):
        start_plot_profit(get_args(args))