def test_consistency(self): uuid = str('10000') vb = 42 seq = 101 ixname = 'ix' mutinfo = (vb, uuid, seq, 'dummy-bucket-name') ms = MutationState() ms._add_scanvec(mutinfo) params = cbft.Params() params.consistent_with(ms) got = cbft.make_search_body('ix', cbft.MatchNoneQuery(), params) exp = { 'indexName': ixname, 'query': { 'match_none': None }, 'ctl': { 'consistency': { 'level': 'at_plus', 'vectors': { ixname: { '{0}/{1}'.format(vb, uuid): seq } } } } } self.assertEqual(exp, got)
def test_match_all_none_queries(self): self.assertEqual({'match_all': None}, cbft.MatchAllQuery().encodable) self.assertEqual({'match_none': None}, cbft.MatchNoneQuery().encodable)