Refactored class methods
This commit is contained in:
@@ -193,7 +193,7 @@ def test_filter_attribute_value_assertions_0(AVA):
|
||||
})
|
||||
|
||||
ava = filter_attribute_value_assertions(AVA[3].copy(),
|
||||
p.get_attribute_restriction(""))
|
||||
p.get_attribute_restrictions(""))
|
||||
|
||||
print ava
|
||||
assert ava.keys() == ["surName"]
|
||||
@@ -211,7 +211,7 @@ def test_filter_attribute_value_assertions_1(AVA):
|
||||
})
|
||||
|
||||
ava = filter_attribute_value_assertions(AVA[0].copy(),
|
||||
p.get_attribute_restriction(""))
|
||||
p.get_attribute_restrictions(""))
|
||||
|
||||
print ava
|
||||
assert _eq(ava.keys(), ["givenName", "surName"])
|
||||
@@ -219,7 +219,7 @@ def test_filter_attribute_value_assertions_1(AVA):
|
||||
assert ava["givenName"] == ["Derek"]
|
||||
|
||||
ava = filter_attribute_value_assertions(AVA[1].copy(),
|
||||
p.get_attribute_restriction(""))
|
||||
p.get_attribute_restrictions(""))
|
||||
|
||||
print ava
|
||||
assert _eq(ava.keys(), ["surName"])
|
||||
@@ -236,20 +236,20 @@ def test_filter_attribute_value_assertions_2(AVA):
|
||||
})
|
||||
|
||||
ava = filter_attribute_value_assertions(AVA[0].copy(),
|
||||
p.get_attribute_restriction(""))
|
||||
p.get_attribute_restrictions(""))
|
||||
|
||||
print ava
|
||||
assert _eq(ava.keys(), [])
|
||||
|
||||
ava = filter_attribute_value_assertions(AVA[1].copy(),
|
||||
p.get_attribute_restriction(""))
|
||||
p.get_attribute_restrictions(""))
|
||||
|
||||
print ava
|
||||
assert _eq(ava.keys(), ["givenName"])
|
||||
assert ava["givenName"] == ["Ryan"]
|
||||
|
||||
ava = filter_attribute_value_assertions(AVA[3].copy(),
|
||||
p.get_attribute_restriction(""))
|
||||
p.get_attribute_restrictions(""))
|
||||
|
||||
print ava
|
||||
assert _eq(ava.keys(), ["givenName"])
|
||||
@@ -797,4 +797,4 @@ def test_assertion_with_authn_instant():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
test_assertion_with_authn_instant()
|
||||
test_assertion_2()
|
@@ -238,7 +238,7 @@ def test_idp_1():
|
||||
assert c.endpoint("single_sign_on_service")[0] == 'http://localhost:8088/'
|
||||
|
||||
attribute_restrictions = c.getattr("policy",
|
||||
"idp").get_attribute_restriction("")
|
||||
"idp").get_attribute_restrictions("")
|
||||
assert attribute_restrictions["edupersonaffiliation"][0].match("staff")
|
||||
|
||||
|
||||
@@ -253,7 +253,7 @@ def test_idp_2():
|
||||
BINDING_HTTP_REDIRECT) == ["http://localhost:8088/"]
|
||||
|
||||
attribute_restrictions = c.getattr("policy",
|
||||
"idp").get_attribute_restriction("")
|
||||
"idp").get_attribute_restrictions("")
|
||||
assert attribute_restrictions["edupersonaffiliation"][0].match("staff")
|
||||
|
||||
|
||||
|
@@ -83,6 +83,7 @@ def test_cert_from_instance_ssp():
|
||||
print str(decoder.decode(der)).replace('.', "\n.")
|
||||
assert decoder.decode(der)
|
||||
|
||||
|
||||
class FakeConfig():
|
||||
"""
|
||||
Configuration parameters for signature validation test cases.
|
||||
@@ -94,6 +95,12 @@ class FakeConfig():
|
||||
cert_file = PUB_KEY
|
||||
key_file = PRIV_KEY
|
||||
debug = False
|
||||
cert_handler_extra_class = None
|
||||
generate_cert_info = False
|
||||
tmp_cert_file = None
|
||||
tmp_key_file = None
|
||||
validate_certificate = False
|
||||
|
||||
|
||||
class TestSecurity():
|
||||
|
||||
@@ -418,3 +425,7 @@ class TestSecurityMetadata():
|
||||
item = self.sec.check_signature(sass, class_name(sass), sign_ass)
|
||||
|
||||
assert isinstance(item, saml.Assertion)
|
||||
|
||||
if __name__ == "__main__":
|
||||
t = TestSecurity()
|
||||
t.setup_class()
|
||||
|
Reference in New Issue
Block a user