Cache markets in the exchange object

This commit is contained in:
Matthias
2021-01-28 19:40:10 +01:00
parent 65459086a3
commit 5cdd9dd445
4 changed files with 24 additions and 22 deletions

View File

@@ -2100,6 +2100,7 @@ def test_close_trade(default_conf, ticker, limit_buy_order, limit_buy_order_open
def test_bot_loop_start_called_once(mocker, default_conf, caplog):
ftbot = get_patched_freqtradebot(mocker, default_conf)
mocker.patch('freqtrade.freqtradebot.FreqtradeBot.create_trade')
patch_get_signal(ftbot)
ftbot.strategy.bot_loop_start = MagicMock(side_effect=ValueError)
ftbot.strategy.analyze = MagicMock()
@@ -3810,6 +3811,8 @@ def test_get_real_amount_fromorder(default_conf, trades_for_order, buy_order_fee
open_order_id="123456"
)
freqtrade = get_patched_freqtradebot(mocker, default_conf)
# Ticker rate cannot be found for this to work.
mocker.patch('freqtrade.exchange.Exchange.fetch_ticker', side_effect=ExchangeError)
# Amount is reduced by "fee"
assert freqtrade.get_real_amount(trade, limit_buy_order) == amount - 0.004