'Verify S3GroupedItems behavior for multiple grouping axes'

def testMultiAxisGrouping(self):

    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    items = [{'name': 'Item1', 't1': 'A', 't2': '1', 't3': 'X'}, {'name': 'Item2', 't1': 'B', 't2': '2', 't3': 'Y'}, {'name': 'Item3', 't1': 'C', 't2': '3', 't3': 'X'}, {'name': 'Item4', 't1': 'A', 't2': '3', 't3': 'Z'}, {'name': 'Item5', 't1': 'C', 't2': '2', 't3': 'X'}, {'name': 'Item6', 't1': 'D', 't2': '2', 't3': 'X'}]
    axes = ['t1', 't2', 't3']
    gi = S3GroupedItems(items, groupby=axes)
    group = gi
    for (depth, axis) in enumerate(axes):
        assertEqual(axes[depth], group.key)
        subgroups = list(group.groups)
        assertTrue((len(subgroups) > 0))
        group = subgroups[0]
    assertEqual(len(list(group.groups)), 0)
