Parametrized more time machine tests in test_update_funding_fees

This commit is contained in:
Sam Germain 2021-10-11 01:31:21 -06:00
parent 3b962433fb
commit 855b26f846
2 changed files with 7 additions and 4 deletions

View File

@ -120,7 +120,7 @@ class FreqtradeBot(LoggingMixin):
# TODO: funding interval, specified by funding_fee_times on the exchange classes # TODO: funding interval, specified by funding_fee_times on the exchange classes
for time_slot in range(0, 24): for time_slot in range(0, 24):
for minutes in [0, 15, 30, 45]: for minutes in [0, 15, 30, 45]:
t = str(time(time_slot, minutes)) t = str(time(time_slot, minutes, 2))
schedule.every().day.at(t).do(update) schedule.every().day.at(t).do(update)
def notify_status(self, msg: str) -> None: def notify_status(self, msg: str) -> None:

View File

@ -4,7 +4,6 @@
import logging import logging
import time import time
from copy import deepcopy from copy import deepcopy
# from datetime import tzinfo
from math import isclose from math import isclose
from unittest.mock import ANY, MagicMock, PropertyMock from unittest.mock import ANY, MagicMock, PropertyMock
@ -4285,8 +4284,12 @@ def test_get_valid_price(mocker, default_conf_usdt) -> None:
@pytest.mark.parametrize('trading_mode,calls,t1,t2', [ @pytest.mark.parametrize('trading_mode,calls,t1,t2', [
(TradingMode.SPOT, 0, "2021-09-01 00:00:00", "2021-09-01 08:00:00"), (TradingMode.SPOT, 0, "2021-09-01 00:00:00", "2021-09-01 08:00:00"),
(TradingMode.MARGIN, 0, "2021-09-01 00:00:00", "2021-09-01 08:00:00"), (TradingMode.MARGIN, 0, "2021-09-01 00:00:00", "2021-09-01 08:00:00"),
(TradingMode.FUTURES, 32, "2021-09-01 00:00:01", "2021-09-01 08:00:00"), (TradingMode.FUTURES, 31, "2021-09-01 00:00:02", "2021-09-01 08:00:01"),
(TradingMode.FUTURES, 33, "2021-08-31 23:59:59", "2021-09-01 08:00:01"), # (TradingMode.FUTURES, 32, "2021-09-01 00:00:01", "2021-09-01 08:00:01"),
(TradingMode.FUTURES, 33, "2021-09-01 00:00:01", "2021-09-01 08:00:02"),
(TradingMode.FUTURES, 33, "2021-09-01 00:00:00", "2021-09-01 08:00:02"),
(TradingMode.FUTURES, 34, "2021-08-31 23:59:59", "2021-09-01 08:00:02"),
(TradingMode.FUTURES, 34, "2021-08-31 23:59:59", "2021-09-01 08:00:03"),
]) ])
def test_update_funding_fees(mocker, default_conf, trading_mode, calls, time_machine, def test_update_funding_fees(mocker, default_conf, trading_mode, calls, time_machine,
t1, t2): t1, t2):