Ensure times that fall on a candle are also shifted

This commit is contained in:
Matthias 2020-10-25 10:13:54 +01:00
parent 09af776b66
commit 69e8da30e5

View File

@ -1,6 +1,6 @@
import copy import copy
import logging import logging
from datetime import datetime, timezone from datetime import datetime, timedelta, timezone
from random import randint from random import randint
from unittest.mock import MagicMock, Mock, PropertyMock, patch from unittest.mock import MagicMock, Mock, PropertyMock, patch
@ -2300,6 +2300,9 @@ def test_timeframe_to_next_date():
date = datetime.now(tz=timezone.utc) date = datetime.now(tz=timezone.utc)
assert timeframe_to_next_date("5m") > date assert timeframe_to_next_date("5m") > date
date = datetime(2019, 8, 12, 13, 30, 0, tzinfo=timezone.utc)
assert timeframe_to_next_date("5m", date) == date + timedelta(minutes=5)
@pytest.mark.parametrize("market_symbol,base,quote,exchange,add_dict,expected_result", [ @pytest.mark.parametrize("market_symbol,base,quote,exchange,add_dict,expected_result", [
("BTC/USDT", 'BTC', 'USDT', "binance", {}, True), ("BTC/USDT", 'BTC', 'USDT', "binance", {}, True),