'Test export of nodes'

def testExportNode(self):

    assertEqual = self.assertEqual
    assertTrue = self.assertTrue
    assertFalse = self.assertFalse
    h = S3Hierarchy('test_hierarchy')
    data = dict(((self.uids[uid], self.rows[uid]) for uid in self.uids))
    root = self.uids['HIERARCHY1']
    output = h.export_node(root, depth=2, prefix='_export', data=data, hcol='test_hierarchy.name', columns=['test_hierarchy.category'])
    assertEqual(len(output), 7)
    for row in output:
        next_level = True
        for i in xrange(2):
            hcol = ('_export.%s' % i)
            assertTrue((hcol in row))
            label = row[hcol]
            if ((label != '') and next_level):
                assertEqual(label[:6], 'Type    1')
            else:
                next_level = False
                assertEqual(label, '')
        assertTrue(('test_hierarchy.category' in row))
        assertFalse(('test_hierarchy.name' in row))
