update tests

This commit is contained in:
மனோஜ்குமார் பழனிச்சாமி 2022-05-13 21:04:35 +05:30
parent e6d163df5d
commit 2dbeb12511
3 changed files with 13 additions and 7 deletions

View File

@ -549,7 +549,7 @@ class FreqtradeBot(LoggingMixin):
return
else:
logger.debug("Max adjustment entries is set to unlimited.")
self.execute_entry(trade.pair, stake_amount, current_entry_rate,
self.execute_entry(trade.pair, stake_amount, None and current_entry_rate,
trade=trade, is_short=trade.is_short)
if stake_amount is not None and stake_amount < 0.0:

View File

@ -581,6 +581,12 @@ class LocalTrade():
payment = "BUY" if self.is_short else "SELL"
# * On margin shorts, you buy a little bit more than the amount (amount + interest)
logger.info(f'{order.order_type.upper()}_{payment} has been fulfilled for {self}.')
# condition to avoid reset value when updating fees
if self.open_order_id == order.order_id:
self.open_order_id = None
else:
logger.warning(
f'Got different open_order_id {self.open_order_id} != {order.order_id}')
if isclose(order.safe_amount_after_fee,
self.amount, abs_tol=MATH_CLOSE_PREC):
self.close(order.safe_price)

View File

@ -3213,7 +3213,7 @@ def test_execute_trade_exit_up(default_conf_usdt, ticker_usdt, fee, ticker_usdt_
'close_date': ANY,
'close_rate': ANY,
'sub_trade': False,
'stake_amount': 60.0,
'stake_amount': pytest.approx(60),
} == last_msg
@ -3275,7 +3275,7 @@ def test_execute_trade_exit_down(default_conf_usdt, ticker_usdt, fee, ticker_usd
'close_date': ANY,
'close_rate': ANY,
'sub_trade': False,
'stake_amount': 60.0,
'stake_amount': pytest.approx(60),
} == last_msg
@ -3358,7 +3358,7 @@ def test_execute_trade_exit_custom_exit_price(
'close_date': ANY,
'close_rate': ANY,
'sub_trade': False,
'stake_amount': 60.0,
'stake_amount': pytest.approx(60),
} == last_msg
@ -3428,7 +3428,7 @@ def test_execute_trade_exit_down_stoploss_on_exchange_dry_run(
'close_date': ANY,
'close_rate': ANY,
'sub_trade': False,
'stake_amount': 60.0,
'stake_amount': pytest.approx(60),
} == last_msg
@ -3688,7 +3688,7 @@ def test_execute_trade_exit_market_order(
'close_date': ANY,
'close_rate': ANY,
'sub_trade': False,
'stake_amount': 60.0,
'stake_amount': pytest.approx(60),
} == last_msg
@ -5613,7 +5613,7 @@ def test_position_adjust2(mocker, default_conf_usdt, fee) -> None:
assert trade.stake_amount == bid * amount
assert not trade.fee_updated('buy')
freqtrade.check_handle_timedout()
freqtrade.manage_open_orders()
trade = Trade.query.first()
assert trade