stoploss_adjust fixed breaking tests
This commit is contained in:
parent
7db28b1b16
commit
6f4d607902
@ -94,20 +94,6 @@ def test_stoploss_order_dry_run_binance(default_conf, mocker):
|
|||||||
assert order['amount'] == 1
|
assert order['amount'] == 1
|
||||||
|
|
||||||
|
|
||||||
def test_stoploss_adjust_binance(mocker, default_conf):
|
|
||||||
exchange = get_patched_exchange(mocker, default_conf, id='binance')
|
|
||||||
order = {
|
|
||||||
'type': 'stop_loss_limit',
|
|
||||||
'price': 1500,
|
|
||||||
'info': {'stopPrice': 1500},
|
|
||||||
}
|
|
||||||
assert exchange.stoploss_adjust(1501, order)
|
|
||||||
assert not exchange.stoploss_adjust(1499, order)
|
|
||||||
# Test with invalid order case
|
|
||||||
order['type'] = 'stop_loss'
|
|
||||||
assert not exchange.stoploss_adjust(1501, order)
|
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
@pytest.mark.asyncio
|
||||||
async def test__async_get_historic_ohlcv_binance(default_conf, mocker, caplog):
|
async def test__async_get_historic_ohlcv_binance(default_conf, mocker, caplog):
|
||||||
ohlcv = [
|
ohlcv = [
|
||||||
|
@ -2698,9 +2698,6 @@ def test_stoploss_order_unsupported_exchange(default_conf, mocker):
|
|||||||
with pytest.raises(OperationalException, match=r"stoploss is not implemented .*"):
|
with pytest.raises(OperationalException, match=r"stoploss is not implemented .*"):
|
||||||
exchange.stoploss(pair='ETH/BTC', amount=1, stop_price=220, order_types={})
|
exchange.stoploss(pair='ETH/BTC', amount=1, stop_price=220, order_types={})
|
||||||
|
|
||||||
with pytest.raises(OperationalException, match=r"stoploss is not implemented .*"):
|
|
||||||
exchange.stoploss_adjust(1, {})
|
|
||||||
|
|
||||||
|
|
||||||
def test_merge_ft_has_dict(default_conf, mocker):
|
def test_merge_ft_has_dict(default_conf, mocker):
|
||||||
mocker.patch.multiple('freqtrade.exchange.Exchange',
|
mocker.patch.multiple('freqtrade.exchange.Exchange',
|
||||||
|
@ -1563,9 +1563,7 @@ def test_tsl_on_exchange_compatible_with_edge(mocker, edge_conf, fee,
|
|||||||
'type': 'stop_loss_limit',
|
'type': 'stop_loss_limit',
|
||||||
'price': 3,
|
'price': 3,
|
||||||
'average': 2,
|
'average': 2,
|
||||||
'info': {
|
'stopPrice': '2.178'
|
||||||
'stopPrice': '2.178'
|
|
||||||
}
|
|
||||||
})
|
})
|
||||||
|
|
||||||
mocker.patch('freqtrade.exchange.Exchange.fetch_stoploss_order', stoploss_order_hanging)
|
mocker.patch('freqtrade.exchange.Exchange.fetch_stoploss_order', stoploss_order_hanging)
|
||||||
|
Loading…
Reference in New Issue
Block a user