def testGrouping(self):

        period = self.period
        period.group()

        assertTrue = self.assertTrue
        assertEqual = self.assertEqual

        # Check rows
        expected_rows = {"A": ((1, 2, 7, 8), ()),
                         "B": ((3, 4, 9, 10), ()),
                         "C": ((5, 6, 11, 12), ()),
                         }
        rows = period._rows
        assertEqual(set(rows.keys()), set(expected_rows.keys()))
        for k, v in rows.items():
            expected_current = set(expected_rows.get(k)[0])
            assertEqual(v[0], expected_current,
                        msg = "Row %s current events: %s != %s" %
                              (k, v[0], expected_current))
            expected_previous = set(expected_rows.get(k)[1])
            assertEqual(v[1], expected_previous,
                        msg = "Row %s previous events: %s != %s" %
                              (k, v[1], expected_previous))

        # Check columns
        assertEqual(period._cols, {})

        # Check matrix
        assertEqual(period._matrix, {})

    # -------------------------------------------------------------------------
Test grouping of period events (single axis)
dataset/ETHPy150Open sahana/eden/modules/unit_tests/s3/s3timeplot.py/PeriodTestsSingleAxis.testGrouping