Updated tests

This commit is contained in:
Roland Hedberg
2009-11-07 20:39:54 +01:00
parent ac42db23f8
commit 0cfe8d446e
3 changed files with 15 additions and 11 deletions

View File

@@ -2,10 +2,13 @@
"entityid" : "urn:mace:umu.se:saml:roland:sp",
"my_name" : "urn:mace:umu.se:saml:roland:sp",
"service_url" : "http://lingon.catalogix.se:8087/",
"service": ["sp"],
"debug" : 1,
"my_key" : "./mykey.pem",
"my_cert" : "./mycert.pem",
"xmlsec_binary" : "/opt/local/bin/xmlsec1",
"metadata": ["/Users/rolandh/code/pysaml2/tests/metadata.xml"],
"metadata": {
"local": ["/Users/rolandh/code/pysaml2/tests/metadata.xml"],
},
"idp_entity_id": "urn:mace:umu.se:saml:roland:idp",
}

View File

@@ -3,7 +3,7 @@
from saml2.client import Saml2Client
from saml2 import samlp, client
from saml2 import saml, utils
from saml2 import saml, utils, config
XML_RESPONSE_FILE = "tests/saml_signed.xml"
XML_RESPONSE_FILE2 = "tests/saml2_response.xml"
@@ -54,7 +54,8 @@ REQ1 = """<?xml version='1.0' encoding='UTF-8'?>
class TestClient:
def setup_class(self):
conf = client.verify_sp_conf("tests/server.config")
conf = config.Config()
conf.load_file("tests/server.config")
self.client = Saml2Client({},conf)
def test_verify_1(self):
@@ -96,7 +97,7 @@ class TestClient:
assert name_id == "_242f88493449e639aab95dd9b92b1d04234ab84fd8"
def test_create_attribute_query1(self):
req = self.client.create_attribute_request("1",
req = self.client.create_attribute_query("1",
"E8042FB4-4D5B-48C3-8E14-8EDD852790DD",
"http://vo.example.com/sp1",
"https://idp.example.com/idp/" )
@@ -114,7 +115,7 @@ class TestClient:
assert issuer.text == "http://vo.example.com/sp1"
def test_create_attribute_query2(self):
req = self.client.create_attribute_request("1",
req = self.client.create_attribute_query("1",
"E8042FB4-4D5B-48C3-8E14-8EDD852790DD",
"http://vo.example.com/sp1",
"https://idp.example.com/idp/",
@@ -155,7 +156,7 @@ class TestClient:
assert set(seen) == set(["givenName","surname","email"])
def test_create_attribute_query_3(self):
req = self.client.create_attribute_request("1",
req = self.client.create_attribute_query("1",
"_e7b68a04488f715cda642fbdd90099f5",
"urn:mace:umu.se:saml/rolandsp",
"https://aai-demo-idp.switch.ch/idp/shibboleth",

View File

@@ -283,7 +283,7 @@ class TestServer():
intermed = utils.deflate_and_base64_encode("%s" % authn_request)
# should raise an error because faulty spentityid
raises(OtherError,self.server.parse_request,intermed)
raises(OtherError,self.server.parse_authn_request,intermed)
def test_parse_faulty_request_to_err_status(self):
authn_request = client.d_authn_request(
@@ -296,7 +296,7 @@ class TestServer():
intermed = utils.deflate_and_base64_encode("%s" % authn_request)
try:
self.server.parse_request(intermed)
self.server.parse_authn_request(intermed)
status = None
except OtherError, oe:
print oe.args
@@ -323,9 +323,9 @@ class TestServer():
)
intermed = utils.deflate_and_base64_encode("%s" % authn_request)
(consumer_url, id, name_id_policies, sp) = self.server.parse_request(
intermed)
(consumer_url, id, name_id_policies,
sp) = self.server.parse_authn_request(intermed)
assert consumer_url == "http://localhost:8087/"
assert id == "1"
assert name_id_policies == saml.NAMEID_FORMAT_TRANSIENT