diff options
author | Clint Byrum <clint@fewbar.com> | 2015-05-24 10:03:20 -0700 |
---|---|---|
committer | Clint Byrum <clint@fewbar.com> | 2015-05-28 09:50:57 -0700 |
commit | fb17c4f70294bc54072dd2aef1bf55cc44a9327a (patch) | |
tree | 91a67a50fbce5235444e6e3d6e679ef10668d8c5 /tests/test_37_entity_categories.py | |
parent | f1305a3302d24676966dbe094b9b18eb8f6e1ae9 (diff) | |
download | pysaml2-fb17c4f70294bc54072dd2aef1bf55cc44a9327a.tar.gz |
Fixing py3 errors caused by views in assertions
Assertions code had some assumptions that dict method iterators would
return the actual type. Forcing a cast to list remedies that.
Diffstat (limited to 'tests/test_37_entity_categories.py')
-rw-r--r-- | tests/test_37_entity_categories.py | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/tests/test_37_entity_categories.py b/tests/test_37_entity_categories.py index 3f2a05a5..61db1c67 100644 --- a/tests/test_37_entity_categories.py +++ b/tests/test_37_entity_categories.py @@ -56,7 +56,7 @@ def test_filter_ava(): ava = policy.filter(ava, "https://connect.sunet.se/shibboleth", MDS) - assert _eq(ava.keys(), ['mail', 'givenName', 'sn', 'c']) + assert _eq(list(ava.keys()), ['mail', 'givenName', 'sn', 'c']) assert _eq(ava["mail"], ["derek@nyy.mlb.com", "dj@example.com"]) @@ -77,7 +77,7 @@ def test_filter_ava2(): # Mismatch, policy deals with eduGAIN, metadata says SWAMID # So only minimum should come out - assert _eq(ava.keys(), ['eduPersonTargetedID']) + assert _eq(list(ava.keys()), ['eduPersonTargetedID']) def test_filter_ava3(): @@ -100,7 +100,7 @@ def test_filter_ava3(): ava = policy.filter(ava, "urn:mace:example.com:saml:roland:sp", mds) - assert _eq(ava.keys(), ['eduPersonTargetedID', "norEduPersonNIN"]) + assert _eq(list(ava.keys()), ['eduPersonTargetedID', "norEduPersonNIN"]) def test_filter_ava4(): @@ -123,7 +123,7 @@ def test_filter_ava4(): ava = policy.filter(ava, "urn:mace:example.com:saml:roland:sp", mds) - assert _eq(ava.keys(), ['eduPersonTargetedID', "givenName", "c", "mail", + assert _eq(list(ava.keys()), ['eduPersonTargetedID', "givenName", "c", "mail", "sn"]) @@ -147,7 +147,7 @@ def test_filter_ava5(): ava = policy.filter(ava, "urn:mace:example.com:saml:roland:sp", mds) - assert _eq(ava.keys(), ['eduPersonTargetedID']) + assert _eq(list(ava.keys()), ['eduPersonTargetedID']) def test_idp_policy_filter(): @@ -161,7 +161,7 @@ def test_idp_policy_filter(): ava = policy.filter(ava, "urn:mace:example.com:saml:roland:sp", idp.metadata) print(ava) - assert ava.keys() == ["eduPersonTargetedID"] # because no entity category + assert list(ava.keys()) == ["eduPersonTargetedID"] # because no entity category if __name__ == "__main__": test_idp_policy_filter() |