'Test iteration over periods (weeks)'

def testPeriodsWeeks(self):

    assertEqual = self.assertEqual
    ef = S3TimeSeriesEventFrame(tp_datetime(2011, 1, 5), tp_datetime(2011, 1, 28), slots='weeks')
    expected = [(tp_datetime(2011, 1, 5), tp_datetime(2011, 1, 12)), (tp_datetime(2011, 1, 12), tp_datetime(2011, 1, 19)), (tp_datetime(2011, 1, 19), tp_datetime(2011, 1, 26)), (tp_datetime(2011, 1, 26), tp_datetime(2011, 1, 28))]
    for (i, period) in enumerate(ef):
        assertEqual(period.start, expected[i][0])
        assertEqual(period.end, expected[i][1])
    ef = S3TimeSeriesEventFrame(tp_datetime(2011, 1, 5), tp_datetime(2011, 2, 16), slots='2    weeks')
    expected = [(tp_datetime(2011, 1, 5), tp_datetime(2011, 1, 19)), (tp_datetime(2011, 1, 19), tp_datetime(2011, 2, 2)), (tp_datetime(2011, 2, 2), tp_datetime(2011, 2, 16))]
    for (i, period) in enumerate(ef):
        assertEqual(period.start, expected[i][0])
        assertEqual(period.end, expected[i][1])
