'Test iteration over periods (months)'

def testPeriodsMonths(self):

    assertEqual = self.assertEqual
    ef = S3TimeSeriesEventFrame(tp_datetime(2011, 1, 5), tp_datetime(2011, 4, 28), slots='months')
    expected = [(tp_datetime(2011, 1, 5), tp_datetime(2011, 2, 5)), (tp_datetime(2011, 2, 5), tp_datetime(2011, 3, 5)), (tp_datetime(2011, 3, 5), tp_datetime(2011, 4, 5)), (tp_datetime(2011, 4, 5), tp_datetime(2011, 4, 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, 8, 16), slots='3    months')
    expected = [(tp_datetime(2011, 1, 5), tp_datetime(2011, 4, 5)), (tp_datetime(2011, 4, 5), tp_datetime(2011, 7, 5)), (tp_datetime(2011, 7, 5), tp_datetime(2011, 8, 16))]
    for (i, period) in enumerate(ef):
        assertEqual(period.start, expected[i][0])
        assertEqual(period.end, expected[i][1])
