Merge pull request #7068 from freqtrade/ccxt_ordertype_validations

Ccxt ordertype validations
This commit is contained in:
Matthias
2022-07-11 19:41:05 +02:00
committed by GitHub
5 changed files with 28 additions and 13 deletions

View File

@@ -153,6 +153,25 @@ class TestCCXTExchange():
assert isinstance(markets[pair], dict)
assert exchange.market_is_spot(markets[pair])
def test_has_validations(self, exchange):
exchange, exchangename = exchange
exchange.validate_ordertypes({
'entry': 'limit',
'exit': 'limit',
'stoploss': 'limit',
})
if exchangename == 'gateio':
# gateio doesn't have market orders on spot
return
exchange.validate_ordertypes({
'entry': 'market',
'exit': 'market',
'stoploss': 'market',
})
def test_load_markets_futures(self, exchange_futures):
exchange, exchangename = exchange_futures
if not exchange:

View File

@@ -1027,10 +1027,9 @@ def test_validate_ordertypes(default_conf, mocker):
'stoploss': 'market',
'stoploss_on_exchange': False
}
# TODO: Revert once createMarketOrder is available again.
# with pytest.raises(OperationalException,
# match=r'Exchange .* does not support market orders.'):
# Exchange(default_conf)
with pytest.raises(OperationalException,
match=r'Exchange .* does not support market orders.'):
Exchange(default_conf)
default_conf['order_types'] = {
'entry': 'limit',