'Test for the GenFileData() method.'

def testGenFileData(self):

    self.assertRaises(test_lib.Error, self.GenFileData, 'EMPTY', [])
    parser = parsers.FileParser()
    result = self.GenFileData('EMPTY', [], parser)
    self.assertTrue(('KnowledgeBase' in result))
    self.assertTrue(('EMPTY' in result))
    self.assertDictEqual(self.SetArtifactData(), result['EMPTY'])
    result = self.GenFileData('FILES', {'/tmp/foo': 'blah', '/tmp/bar': 'meh'}, parser)
    self.assertTrue(('FILES' in result))
    self.assertEquals([], result['FILES']['PARSER'])
    self.assertEquals(2, len(result['FILES']['RAW']))
    statentry = None
    for r in result['FILES']['RAW']:
        if (r.pathspec.path == '/tmp/bar'):
            statentry = r
    self.assertIsInstance(statentry, rdf_client.StatEntry)
    self.assertEquals(33188, statentry.st_mode)
