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

@@ -109,8 +109,10 @@ class TestSecurity():
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

@@ -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"