'Test that append attribute works.'

def testAppendAttribute(self):

    obj = aff4.FACTORY.Create('foobar', aff4.AFF4Object, token=self.token)
    obj.Set(obj.Schema.STORED('www.google.com'))
    obj.Close()
    obj = aff4.FACTORY.Open('foobar', mode='rw', token=self.token, age=aff4.ALL_TIMES)
    self.assertEqual(1, len(list(obj.GetValuesForAttribute(obj.Schema.STORED))))
    for i in range(5):
        obj.AddAttribute(obj.Schema.STORED(('example.com/%s' % i)))
    self.assertEqual(6, len(list(obj.GetValuesForAttribute(obj.Schema.STORED))))
    obj.Close()
    obj = aff4.FACTORY.Open('foobar', token=self.token, age=aff4.ALL_TIMES)
    self.assertEqual(6, len(list(obj.GetValuesForAttribute(obj.Schema.STORED))))
