Rename process_maybe_execute_buys() --> enter_positions()

This commit is contained in:
hroff-1902
2019-12-30 22:50:56 +03:00
parent 84918ad424
commit fd7af587da
6 changed files with 96 additions and 88 deletions

View File

@@ -188,8 +188,8 @@ def test_status(default_conf, update, mocker, fee, ticker,) -> None:
telegram = Telegram(freqtradebot)
# Create some test data
for _ in range(3):
freqtradebot.process_maybe_execute_buys()
n = freqtradebot.enter_positions()
assert n == 1
telegram._status(update=update, context=MagicMock())
assert msg_mock.call_count == 1
@@ -236,7 +236,7 @@ def test_status_handle(default_conf, update, ticker, fee, mocker) -> None:
msg_mock.reset_mock()
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
# Trigger status while we have a fulfilled order for the open trade
telegram._status(update=update, context=MagicMock())
@@ -285,7 +285,7 @@ def test_status_table_handle(default_conf, update, ticker, fee, mocker) -> None:
msg_mock.reset_mock()
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
telegram._status_table(update=update, context=MagicMock())
@@ -322,7 +322,7 @@ def test_daily_handle(default_conf, update, ticker, limit_buy_order, fee,
telegram = Telegram(freqtradebot)
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
trade = Trade.query.first()
assert trade
@@ -352,7 +352,8 @@ def test_daily_handle(default_conf, update, ticker, limit_buy_order, fee,
msg_mock.reset_mock()
freqtradebot.config['max_open_trades'] = 2
# Add two other trades
freqtradebot.process_maybe_execute_buys()
n = freqtradebot.enter_positions()
assert n == 2
trades = Trade.query.all()
for trade in trades:
@@ -431,7 +432,7 @@ def test_profit_handle(default_conf, update, ticker, ticker_sell_up, fee,
msg_mock.reset_mock()
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
trade = Trade.query.first()
# Simulate fulfilled LIMIT_BUY order for trade
@@ -709,7 +710,7 @@ def test_forcesell_handle(default_conf, update, ticker, fee,
telegram = Telegram(freqtradebot)
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
trade = Trade.query.first()
assert trade
@@ -764,7 +765,7 @@ def test_forcesell_down_handle(default_conf, update, ticker, fee,
telegram = Telegram(freqtradebot)
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
# Decrease the price and sell it
mocker.patch.multiple(
@@ -821,7 +822,7 @@ def test_forcesell_all_handle(default_conf, update, ticker, fee, mocker) -> None
telegram = Telegram(freqtradebot)
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
rpc_mock.reset_mock()
# /forcesell all
@@ -971,7 +972,7 @@ def test_performance_handle(default_conf, update, ticker, fee,
telegram = Telegram(freqtradebot)
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
trade = Trade.query.first()
assert trade
@@ -1014,7 +1015,7 @@ def test_count_handle(default_conf, update, ticker, fee, mocker) -> None:
freqtradebot.state = State.RUNNING
# Create some test data
freqtradebot.process_maybe_execute_buys()
freqtradebot.enter_positions()
msg_mock.reset_mock()
telegram._count(update=update, context=MagicMock())