'Test that GetValuesForAttribute returns versions in the right order.'

def testVersionOrder(self):

    client = aff4.FACTORY.Create(self.client_id, aff4_grr.VFSGRRClient, mode='w', token=self.token)
    client.Set(client.Schema.HOSTNAME('Host1'))
    client.Flush()
    client.Set(client.Schema.HOSTNAME('Host2'))
    client.Flush()
    self.assertEqual(client.Get(client.Schema.HOSTNAME), 'Host2')
    client = aff4.FACTORY.Open(self.client_id, token=self.token, age=aff4.ALL_TIMES)
    self.assertEqual(list(client.GetValuesForAttribute(client.Schema.HOSTNAME)), ['Host2', 'Host1'])
    self.assertEqual(client.Get(client.Schema.HOSTNAME), 'Host2')
