Update dry-run fill method naming

This commit is contained in:
Matthias
2023-02-16 19:47:12 +01:00
parent f68543b151
commit 9600039686
7 changed files with 32 additions and 34 deletions

View File

@@ -112,7 +112,7 @@ def test_rpc_trade_status(default_conf, ticker, fee, mocker) -> None:
'freqtrade.exchange.Exchange',
fetch_ticker=ticker,
get_fee=fee,
_is_dry_limit_order_filled=MagicMock(side_effect=[False, True]),
_dry_is_price_crossed=MagicMock(side_effect=[False, True]),
)
freqtradebot = get_patched_freqtradebot(mocker, default_conf)
@@ -226,7 +226,7 @@ def test_rpc_status_table(default_conf, ticker, fee, mocker) -> None:
freqtradebot.state = State.RUNNING
with pytest.raises(RPCException, match=r'.*no active trade*'):
rpc._rpc_status_table(default_conf['stake_currency'], 'USD')
mocker.patch('freqtrade.exchange.Exchange._is_dry_limit_order_filled', return_value=False)
mocker.patch('freqtrade.exchange.Exchange._dry_is_price_crossed', return_value=False)
freqtradebot.enter_positions()
result, headers, fiat_profit_sum = rpc._rpc_status_table(default_conf['stake_currency'], 'USD')
@@ -237,7 +237,7 @@ def test_rpc_status_table(default_conf, ticker, fee, mocker) -> None:
assert '0.00' == result[0][3]
assert isnan(fiat_profit_sum)
mocker.patch('freqtrade.exchange.Exchange._is_dry_limit_order_filled', return_value=True)
mocker.patch('freqtrade.exchange.Exchange._dry_is_price_crossed', return_value=True)
freqtradebot.process()
result, headers, fiat_profit_sum = rpc._rpc_status_table(default_conf['stake_currency'], 'USD')
@@ -688,7 +688,7 @@ def test_rpc_force_exit(default_conf, ticker, fee, mocker) -> None:
'filled': 0.0,
}
),
_is_dry_limit_order_filled=MagicMock(return_value=True),
_dry_is_price_crossed=MagicMock(return_value=True),
get_fee=fee,
)
mocker.patch('freqtrade.wallets.Wallets.get_free', return_value=1000)
@@ -726,7 +726,7 @@ def test_rpc_force_exit(default_conf, ticker, fee, mocker) -> None:
freqtradebot.state = State.RUNNING
assert cancel_order_mock.call_count == 0
mocker.patch(
'freqtrade.exchange.Exchange._is_dry_limit_order_filled', MagicMock(return_value=False))
'freqtrade.exchange.Exchange._dry_is_price_crossed', MagicMock(return_value=False))
freqtradebot.enter_positions()
# make an limit-buy open trade
trade = Trade.query.filter(Trade.id == '3').first()

View File

@@ -1280,7 +1280,7 @@ def test_api_forceexit(botclient, mocker, ticker, fee, markets):
fetch_ticker=ticker,
get_fee=fee,
markets=PropertyMock(return_value=markets),
_is_dry_limit_order_filled=MagicMock(return_value=True),
_dry_is_price_crossed=MagicMock(return_value=True),
)
patch_get_signal(ftbot)

View File

@@ -313,7 +313,7 @@ def test_status_handle(default_conf, update, ticker, fee, mocker) -> None:
'freqtrade.exchange.Exchange',
fetch_ticker=ticker,
get_fee=fee,
_is_dry_limit_order_filled=MagicMock(return_value=True),
_dry_is_price_crossed=MagicMock(return_value=True),
)
status_table = MagicMock()
mocker.patch.multiple(
@@ -930,7 +930,7 @@ def test_telegram_forceexit_handle(default_conf, update, ticker, fee,
'freqtrade.exchange.Exchange',
fetch_ticker=ticker,
get_fee=fee,
_is_dry_limit_order_filled=MagicMock(return_value=True),
_dry_is_price_crossed=MagicMock(return_value=True),
)
freqtradebot = FreqtradeBot(default_conf)
@@ -999,7 +999,7 @@ def test_telegram_force_exit_down_handle(default_conf, update, ticker, fee,
'freqtrade.exchange.Exchange',
fetch_ticker=ticker,
get_fee=fee,
_is_dry_limit_order_filled=MagicMock(return_value=True),
_dry_is_price_crossed=MagicMock(return_value=True),
)
freqtradebot = FreqtradeBot(default_conf)
@@ -1070,7 +1070,7 @@ def test_forceexit_all_handle(default_conf, update, ticker, fee, mocker) -> None
'freqtrade.exchange.Exchange',
fetch_ticker=ticker,
get_fee=fee,
_is_dry_limit_order_filled=MagicMock(return_value=True),
_dry_is_price_crossed=MagicMock(return_value=True),
)
default_conf['max_open_trades'] = 4
freqtradebot = FreqtradeBot(default_conf)
@@ -1155,7 +1155,7 @@ def test_force_exit_no_pair(default_conf, update, ticker, fee, mocker) -> None:
'freqtrade.exchange.Exchange',
fetch_ticker=ticker,
get_fee=fee,
_is_dry_limit_order_filled=MagicMock(return_value=True),
_dry_is_price_crossed=MagicMock(return_value=True),
)
femock = mocker.patch('freqtrade.rpc.rpc.RPC._rpc_force_exit')
telegram, freqtradebot, msg_mock = get_telegram_testobject(mocker, default_conf)