There are more versions then the two I handled

This commit is contained in:
Roland Hedberg
2011-04-19 20:44:33 +02:00
parent d426a9d18d
commit 39e3cb76ae
2 changed files with 13 additions and 6 deletions

View File

@@ -108,9 +108,11 @@ class TestSecurity():
xmlexec = get_xmlsec_binary()
self.sec = sigver.SecurityContext(xmlexec, PRIV_KEY, "pem",
PUB_KEY, "pem", debug=1)
#self.sign_digest = SIGNATURE_DIGEST[xmlsec_version(xmlexec)]
self.sign_digest = SIGNATURE_DIGEST["1.2.16"]
try:
self.sign_digest = SIGNATURE_DIGEST[xmlsec_version(xmlexec)]
except KeyError:
self.sign_digest = SIGNATURE_DIGEST["1.2.14"]
self._assertion = factory( saml.Assertion,
version="2.0",

View File

@@ -62,7 +62,7 @@ class TestClient:
self.client = Saml2Client(conf)
def test_create_attribute_query1(self):
req = self.client.create_attribute_query("id1",
req = self.client.create_attribute_query("id1",
"E8042FB4-4D5B-48C3-8E14-8EDD852790DD",
"https://idp.example.com/idp/",
nameid_format=saml.NAMEID_FORMAT_PERSISTENT)
@@ -70,8 +70,13 @@ class TestClient:
xmlsec_vers = xmlsec_version(self.client.config.xmlsec_binary)
print "XMLSEC version: %s" % xmlsec_vers
print reqstr
print REQ1[xmlsec_vers] % req.issue_instant
assert reqstr == REQ1["1.2.16"] % req.issue_instant
try:
expected_req = REQ1[xmlsec_vers] % req.issue_instant
except KeyError:
expected_req = REQ1["1.2.14"] % req.issue_instant
print expected_req
assert reqstr == expected_req
#assert reqstr == REQ1[xmlsec_vers] % req.issue_instant
assert req.destination == "https://idp.example.com/idp/"
assert req.id == "id1"