Skip to content
Permalink
Browse files

add testcase for sha1 lookup

  • Loading branch information...
leifj committed Sep 25, 2019
1 parent dc7d53a commit 479cca3eb57c5fde7ef8e0c8cf5384bf301fb305
Showing with 18 additions and 0 deletions.
  1. +18 −0 src/pyff/test/test_store.py
@@ -103,6 +103,15 @@ def test_lookup_wayf(self):
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_select_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')
@@ -218,6 +227,15 @@ def test_lookup_wayf(self):
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 = MemoryStore()
store.update(self.wayf, tid='https://metadata.wayf.dk/wayf-edugain-metadata.xml')
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_select_wayf(self):
store = MemoryStore()
store.update(self.wayf, tid='https://metadata.wayf.dk/wayf-edugain-metadata.xml')

0 comments on commit 479cca3

Please sign in to comment.
You can’t perform that action at this time.