'Test regex Multi Resolving works.'

def testResolveMulti(self):

    subject = 'aff4:/resolve_multi'
    predicates = []
    predicate_values = []
    for i in range(0, 100):
        predicate = ('metadata:predicate' + str(i))
        predicates.append(predicate)
        predicate_values.append(('Cell    ' + predicate))
        data_store.DB.Set(subject, predicate, ('Cell    ' + predicate), timestamp=1000, token=self.token)
    results = [x for x in data_store.DB.ResolveMulti(subject, predicates, token=self.token)]
    self.assertEqual(len(results), 100)
    self.assertItemsEqual(predicates, [x[0] for x in results])
    self.assertItemsEqual(predicate_values, [x[1] for x in results])
    predicates = predicates[:10]
    predicate_values = predicate_values[:10]
    for i in range(10):
        predicates.append(('metadata:not_existing' + str(i)))
    results = [x for x in data_store.DB.ResolveMulti(subject, predicates, token=self.token)]
    self.assertEqual(10, len(results))
    self.assertItemsEqual(predicates[:10], [x[0] for x in results])
    self.assertItemsEqual(predicate_values, [x[1] for x in results])
