Skip to content

Commit

Permalink
changed more occuranes of function
Browse files Browse the repository at this point in the history
  • Loading branch information
jraviotta authored and xmatthias committed Sep 9, 2019
1 parent a5510d1 commit adbc015
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions tests/test_plotting.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from freqtrade.data.btanalysis import create_cum_profit, load_backtest_data
from freqtrade.plot.plot_utils import start_plot_dataframe, start_plot_profit
from freqtrade.plot.plotting import (add_indicators, add_profit,
analyse_and_plot_pairs,
load_and_plot_trades,
generate_candlestick_graph,
generate_plot_filename,
generate_profit_graph, init_plotscript,
Expand Down Expand Up @@ -94,7 +94,7 @@ def test_add_indicators(default_conf, testdatadir, caplog):


def test_plot_trades(testdatadir, caplog):
fig1 = generage_empty_figure()
fig1 = generate_empty_figure()
# nothing happens when no trades are available
fig = plot_trades(fig1, None)
assert fig == fig1
Expand Down Expand Up @@ -230,7 +230,7 @@ def test_add_profit(testdatadir):

df = history.load_pair_history(pair="POWR/BTC", ticker_interval='5m',
datadir=testdatadir, timerange=timerange)
fig = generage_empty_figure()
fig = generate_empty_figure()

cum_profits = create_cum_profit(df.set_index('date'),
bt_data[bt_data["pair"] == 'POWR/BTC'],
Expand Down Expand Up @@ -279,7 +279,7 @@ def test_generate_profit_graph(testdatadir):


def test_start_plot_dataframe(mocker):
aup = mocker.patch("freqtrade.plot.plotting.analyse_and_plot_pairs", MagicMock())
aup = mocker.patch("freqtrade.plot.plotting.load_and_plot_trades", MagicMock())
args = [
"--config", "config.json.example",
"plot-dataframe",
Expand All @@ -293,7 +293,7 @@ def test_start_plot_dataframe(mocker):
assert called_config['pairs'] == ["ETH/BTC"]


def test_analyse_and_plot_pairs(default_conf, mocker, caplog, testdatadir):
def test_load_and_plot_trades(default_conf, mocker, caplog, testdatadir):
default_conf['trade_source'] = 'file'
default_conf["datadir"] = testdatadir
default_conf['exportfilename'] = str(testdatadir / "backtest-result_test.json")
Expand All @@ -308,7 +308,7 @@ def test_analyse_and_plot_pairs(default_conf, mocker, caplog, testdatadir):
generate_candlestick_graph=candle_mock,
store_plot_file=store_mock
)
analyse_and_plot_pairs(default_conf)
load_and_plot_trades(default_conf)

# Both mocks should be called once per pair
assert candle_mock.call_count == 2
Expand Down

0 comments on commit adbc015

Please sign in to comment.