'Test the file like object behaviour.'

def TestFileHandling(self, fd):

    original_string = self.GetNumbers()
    self.assertEqual(fd.size, len(original_string))
    fd.Seek(0)
    self.assertEqual(fd.Read(100), original_string[0:100])
    self.assertEqual(fd.Tell(), 100)
    fd.Seek((-10), 1)
    self.assertEqual(fd.Tell(), 90)
    self.assertEqual(fd.Read(10), original_string[90:100])
    fd.Seek(0, 2)
    self.assertEqual(fd.Tell(), len(original_string))
    self.assertEqual(fd.Read(10), '')
    self.assertEqual(fd.Tell(), len(original_string))
    self.assertRaises(IOError, (lambda : list(fd.ListFiles())))
