'Make sure CONTENT_LAST does not update when only STAT is written..'

def testVFSFileContentLastNotUpdated(self):

    path = '/C.12345/contentlastchecker'
    timestamp = 1
    with utils.Stubber(time, 'time', (lambda : timestamp)):
        fd = aff4.FACTORY.Create(path, aff4_grr.VFSFile, mode='w', token=self.token)
        timestamp += 1
        fd.SetChunksize(10)
        for i in range(100):
            fd.Write(('%s%08X\n' % ('Test', i)))
            fd.Flush()
            timestamp += 1
        fd.Set(fd.Schema.STAT, rdf_client.StatEntry())
        fd.Close()
    fd = aff4.FACTORY.Open(path, mode='rw', token=self.token)
    self.assertEqual(int(fd.GetContentAge()), 101000000)
    fd.Set(fd.Schema.STAT, fd.Get(fd.Schema.STAT))
    fd.Flush()
    fd = aff4.FACTORY.Open(path, token=self.token)
    self.assertEqual(int(fd.GetContentAge()), 101000000)
