'Test lookup of descendant nodes'

def testFindAll(self):

    uids = self.uids
    h = S3Hierarchy('test_hierarchy')
    assertEqual = self.assertEqual
    root = uids['HIERARCHY1']
    nodes = h.findall(root)
    expected = ['HIERARCHY1-1', 'HIERARCHY1-1-1', 'HIERARCHY1-1-2', 'HIERARCHY1-2', 'HIERARCHY1-2-1', 'HIERARCHY1-2-2']
    assertEqual(nodes, set((uids[uid] for uid in expected)))
    root = uids['HIERARCHY1']
    nodes = h.findall(root, inclusive=True)
    expected = ['HIERARCHY1', 'HIERARCHY1-1', 'HIERARCHY1-1-1', 'HIERARCHY1-1-2', 'HIERARCHY1-2', 'HIERARCHY1-2-1', 'HIERARCHY1-2-2']
    assertEqual(nodes, set((uids[uid] for uid in expected)))
    root = uids['HIERARCHY2']
    nodes = h.findall(root, category='Cat    1')
    expected = ['HIERARCHY2-1']
    assertEqual(nodes, set((uids[uid] for uid in expected)))
    root = uids['HIERARCHY1']
    nodes = h.findall(root, category='Cat    4')
    assertEqual(nodes, set())
