make it work
This commit is contained in:
@@ -42,7 +42,7 @@ FORM_SPEC = """<form method="post" action="%s">
|
|||||||
LAX = True
|
LAX = True
|
||||||
|
|
||||||
def verify_idp_conf(config_file):
|
def verify_idp_conf(config_file):
|
||||||
config = eval(open(conf_file).read())
|
config = eval(open(config_file).read())
|
||||||
|
|
||||||
# check for those that have to be there
|
# check for those that have to be there
|
||||||
assert "xmlsec_binary" in config
|
assert "xmlsec_binary" in config
|
||||||
@@ -56,7 +56,7 @@ def verify_idp_conf(config_file):
|
|||||||
config["key_file"] = None
|
config["key_file"] = None
|
||||||
|
|
||||||
if "metadata" in config:
|
if "metadata" in config:
|
||||||
md = MetaData()
|
md = metadata.MetaData()
|
||||||
for mdfile in config["metadata"]:
|
for mdfile in config["metadata"]:
|
||||||
md.import_metadata(open(mdfile).read())
|
md.import_metadata(open(mdfile).read())
|
||||||
config["metadata"] = md
|
config["metadata"] = md
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
# -*- coding: utf-8 -*-
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
from saml2.client import Saml2Client
|
from saml2.client import Saml2Client
|
||||||
from saml2 import samlp
|
from saml2 import samlp, client
|
||||||
from saml2 import saml, utils
|
from saml2 import saml, utils
|
||||||
|
|
||||||
XML_RESPONSE_FILE = "tests/saml_signed.xml"
|
XML_RESPONSE_FILE = "tests/saml_signed.xml"
|
||||||
@@ -54,7 +54,8 @@ REQ1 = """<?xml version='1.0' encoding='UTF-8'?>
|
|||||||
|
|
||||||
class TestClient:
|
class TestClient:
|
||||||
def setup_class(self):
|
def setup_class(self):
|
||||||
self.client = Saml2Client({}, xmlsec_binary=XMLSEC_BINARY)
|
conf = client.verify_idp_conf("tests/server.config")
|
||||||
|
self.client = Saml2Client({},conf)
|
||||||
|
|
||||||
def test_verify_1(self):
|
def test_verify_1(self):
|
||||||
xml_response = open(XML_RESPONSE_FILE).read()
|
xml_response = open(XML_RESPONSE_FILE).read()
|
||||||
|
|||||||
Reference in New Issue
Block a user