mirror of
https://github.com/freqtrade/freqtrade.git
synced 2025-12-14 03:41:14 +00:00
test: add test for get_funding_rate_timeframe
This commit is contained in:
@@ -636,3 +636,21 @@ def test_check_delisting(mocker, default_conf_usdt):
|
|||||||
assert res == dt_utc(2025, 10, 2)
|
assert res == dt_utc(2025, 10, 2)
|
||||||
|
|
||||||
assert delist_mock2.call_count == 1
|
assert delist_mock2.call_count == 1
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_funding_rate_timeframe(mocker, default_conf_usdt):
|
||||||
|
default_conf_usdt["trading_mode"] = "futures"
|
||||||
|
default_conf_usdt["margin_mode"] = "isolated"
|
||||||
|
exchange = get_patched_exchange(mocker, default_conf_usdt)
|
||||||
|
mock_get_option = mocker.spy(exchange, "get_option")
|
||||||
|
dp = DataProvider(default_conf_usdt, exchange)
|
||||||
|
|
||||||
|
assert dp.get_funding_rate_timeframe() == "1h"
|
||||||
|
mock_get_option.assert_called_once_with("funding_fee_timeframe")
|
||||||
|
|
||||||
|
|
||||||
|
def test_get_funding_rate_timeframe_no_exchange(default_conf_usdt):
|
||||||
|
dp = DataProvider(default_conf_usdt, None)
|
||||||
|
|
||||||
|
with pytest.raises(OperationalException, match=r"Exchange is not available to DataProvider."):
|
||||||
|
dp.get_funding_rate_timeframe()
|
||||||
|
|||||||
Reference in New Issue
Block a user