From a8f3f2bc1a85d56b360dead4dfba36082afe62dc Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 14 Jul 2019 14:23:23 +0200 Subject: [PATCH] Extend test to cover market orders with price too --- freqtrade/tests/exchange/test_exchange.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/freqtrade/tests/exchange/test_exchange.py b/freqtrade/tests/exchange/test_exchange.py index 9de605ffd..a4f1bca18 100644 --- a/freqtrade/tests/exchange/test_exchange.py +++ b/freqtrade/tests/exchange/test_exchange.py @@ -543,16 +543,17 @@ def test_dry_run_order(default_conf, mocker, side, exchange_name): ("buy"), ("sell") ]) -@pytest.mark.parametrize("ordertype,rate", [ - ("market", None), - ("limit", 200), - ("stop_loss_limit", 200) +@pytest.mark.parametrize("ordertype,rate,marketprice", [ + ("market", None, None), + ("market", 200, True), + ("limit", 200, None), + ("stop_loss_limit", 200, None) ]) @pytest.mark.parametrize("exchange_name", EXCHANGES) -def test_create_order(default_conf, mocker, side, ordertype, rate, exchange_name): +def test_create_order(default_conf, mocker, side, ordertype, rate, marketprice, exchange_name): api_mock = MagicMock() order_id = 'test_prod_{}_{}'.format(side, randint(0, 10 ** 6)) - api_mock.options = {} + api_mock.options = {} if not marketprice else {"createMarketBuyOrderRequiresPrice": True} api_mock.create_order = MagicMock(return_value={ 'id': order_id, 'info': {