Updated log messages for freqtradebot
This commit is contained in:
@@ -1190,7 +1190,7 @@ def test_create_stoploss_order_invalid_order(mocker, default_conf, caplog, fee,
|
||||
assert trade.stoploss_order_id is None
|
||||
assert trade.sell_reason == SellType.EMERGENCY_SELL.value
|
||||
assert log_has("Unable to place a stoploss order on exchange. ", caplog)
|
||||
assert log_has("Selling the trade forcefully", caplog)
|
||||
assert log_has("Exiting the trade forcefully", caplog)
|
||||
|
||||
# Should call a market sell
|
||||
assert create_order_mock.call_count == 2
|
||||
@@ -1659,7 +1659,7 @@ def test_enter_positions(mocker, default_conf, caplog) -> None:
|
||||
MagicMock(return_value=False))
|
||||
n = freqtrade.enter_positions()
|
||||
assert n == 0
|
||||
assert log_has('Found no buy signals for whitelisted currencies. Trying again...', caplog)
|
||||
assert log_has('Found no enter signals for whitelisted currencies. Trying again...', caplog)
|
||||
# create_trade should be called once for every pair in the whitelist.
|
||||
assert mock_ct.call_count == len(default_conf['exchange']['pair_whitelist'])
|
||||
|
||||
@@ -1720,7 +1720,8 @@ def test_exit_positions_exception(mocker, default_conf, limit_buy_order, caplog)
|
||||
)
|
||||
n = freqtrade.exit_positions(trades)
|
||||
assert n == 0
|
||||
assert log_has('Unable to sell trade ETH/BTC: ', caplog)
|
||||
assert log_has('Unable to exit trade ETH/BTC: ', caplog)
|
||||
caplog.clear()
|
||||
|
||||
|
||||
def test_update_trade_state(mocker, default_conf, limit_buy_order, caplog) -> None:
|
||||
@@ -3350,7 +3351,7 @@ def test__safe_sell_amount_error(default_conf, fee, caplog, mocker):
|
||||
)
|
||||
freqtrade = FreqtradeBot(default_conf)
|
||||
patch_get_signal(freqtrade)
|
||||
with pytest.raises(DependencyException, match=r"Not enough amount to sell."):
|
||||
with pytest.raises(DependencyException, match=r"Not enough amount to exit."):
|
||||
assert freqtrade._safe_sell_amount(trade.pair, trade.amount)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user