'Test grouping of period events (single axis)'

def testGrouping(self):

    period = self.period
    period.group()
    assertTrue = self.assertTrue
    assertEqual = self.assertEqual
    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)))
    assertEqual(period._cols, {})
    assertEqual(period._matrix, {})
