def test_lookup_wayf(self): store = RedisWhooshStore(directory=self.dir, clear=True, name="test", redis=fakeredis.FakeStrictRedis()) store.update(self.wayf, tid='https://metadata.wayf.dk/wayf-edugain-metadata.xml') assert store.size() == 77 res = store.lookup("entities") lst = [e.get('entityID') for e in res] assert len(lst) == 77 assert 'https://birk.wayf.dk/birk.php/wayf.supportcenter.dk/its/saml2/idp/metadata.php?unit=its' in lst
def test_lookup_wayf_sha1(self): store = RedisWhooshStore(directory=self.dir, clear=True, name="test", redis=fakeredis.FakeStrictRedis()) store.update(self.wayf, tid='https://metadata.wayf.dk/wayf-edugain-metadata.xml', lazy=False) assert store.size() == 77 res = store.lookup("{sha1}4ece490318a017bc2cc24674f5ad049ad562f7b2") lst = [e.get('entityID') for e in res] assert len(lst) == 1 assert 'https://birk.wayf.dk/birk.php/wayf.supportcenter.dk/its/saml2/idp/metadata.php?unit=its' in lst
def test_lookup_intersect_test01(self): store = RedisWhooshStore(directory=self.dir, clear=True, name="test", redis=fakeredis.FakeStrictRedis()) store.update(self.test01, etag='test01', lazy=False) entity_id = root(self.test01).get('entityID') e = store.lookup("%s=%s+%s=%s" % (ATTRS['domain'], 'example.com', ATTRS['role'], 'idp')) assert len(e) == 1 assert e[0] is not None assert e[0].get('entityID') is not None assert e[0].get('entityID') == entity_id
def test_lookup_test01(self): store = RedisWhooshStore(directory=self.dir, clear=True, name="test", redis=fakeredis.FakeStrictRedis()) store.update(self.test01, etag='test01', lazy=False) entity_id = root(self.test01).get('entityID') e = store.lookup(entity_id) assert len(e) == 1 assert e[0] is not None assert e[0].get('entityID') is not None assert e[0].get('entityID') == entity_id