Skip to content
This repository has been archived by the owner on Mar 24, 2021. It is now read-only.

Commit

Permalink
Test range of quarters
Browse files Browse the repository at this point in the history
  • Loading branch information
phss committed Dec 4, 2013
1 parent 2ef892f commit f1b4796
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tests/core/test_timeseries.py
Original file line number Diff line number Diff line change
Expand Up @@ -346,3 +346,14 @@ def test_end_of_quarter_is_beginning_of_next_quarter(self):
assert_that(QUARTER.end(second_quarter.replace(hour=1)), is_(third_quarter))
assert_that(QUARTER.end(third_quarter.replace(hour=1)), is_(fourth_quarter))
assert_that(QUARTER.end(fourth_quarter.replace(hour=1)), is_(first_quarter_2014))

def test_range_of_quarters(self):
range = QUARTER.range(d_tz(2012, 10, 1), d_tz(2013, 12, 30))

assert_that(list(range), contains(
(d_tz(2012, 10, 1), d_tz(2013, 1, 1)),
(d_tz(2013, 1, 1), d_tz(2013, 4, 1)),
(d_tz(2013, 4, 1), d_tz(2013, 7, 1)),
(d_tz(2013, 7, 1), d_tz(2013, 10, 1)),
(d_tz(2013, 10, 1), d_tz(2014, 1, 1))
))

0 comments on commit f1b4796

Please sign in to comment.