'Test writing content where content length % chunksize == 0.'

def testAppendContent(self):

    src_content = ('ABCDEFG' * 10)
    src_fd = StringIO.StringIO(src_content)
    dest_fd = aff4.FACTORY.Create(aff4.ROOT_URN.Add('temp'), aff4_standard.BlobImage, token=self.token, mode='rw')
    self.assertEqual(dest_fd.Get(dest_fd.Schema.HASHES), None)
    dest_fd.SetChunksize(7)
    dest_fd.AppendContent(src_fd)
    self.assertEqual(int(dest_fd.Get(dest_fd.Schema.SIZE)), len(src_content))
    self.assertTrue(dest_fd.Get(dest_fd.Schema.HASHES))
    dest_fd.Seek(0)
    self.assertEqual(dest_fd.Read(5000), src_content)
    src_fd.seek(0)
    dest_fd.AppendContent(src_fd)
    self.assertEqual(dest_fd.size, (2 * len(src_content)))
    self.assertEqual(int(dest_fd.Get(dest_fd.Schema.SIZE)), (2 * len(src_content)))
    dest_fd.Seek(0)
    self.assertEqual(dest_fd.Read(5000), (src_content + src_content))
