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])

    # -------------------------------------------------------------------------
Test iteration over periods (weeks)
dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3timeplot.py/EventFrameTests.testPeriodsWeeks