Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_get_next_intervalfail2():
with pytest.raises(NotImplementedError):
get_next_interval(date(2016, 4, 18), "decade")
def test_get_next_interval(input_date_string, interval, expect):
get = get_next_interval(_to_date(input_date_string), interval)
assert get == _to_date(expect)
Returns:
[
(begin_date, end_date),
...
]
"""
date_first, date_last = getters.get_min_max_dates(entries,
(Transaction))
if not date_first:
return []
interval_tuples = []
while date_first <= date_last:
next_date = get_next_interval(date_first, interval)
interval_tuples.append((date_first, next_date))
date_first = next_date
return interval_tuples