summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Kanakarakis <ivan.kanak@gmail.com>2021-05-18 01:26:35 +0300
committerIvan Kanakarakis <ivan.kanak@gmail.com>2021-05-18 01:26:35 +0300
commite393022b550c16a663c291b17d93aaed8eb76453 (patch)
tree600f44765a55d1da687ad274e033a350f7b7254c
parent2b5564882562c13f8ade0030be3148dfa7f5a692 (diff)
downloadpysaml2-e393022b550c16a663c291b17d93aaed8eb76453.tar.gz
Format code
Signed-off-by: Ivan Kanakarakis <ivan.kanak@gmail.com>
-rw-r--r--src/saml2/response.py2
-rw-r--r--tests/test_41_response.py81
2 files changed, 44 insertions, 39 deletions
diff --git a/src/saml2/response.py b/src/saml2/response.py
index b5e35149..21abae9a 100644
--- a/src/saml2/response.py
+++ b/src/saml2/response.py
@@ -1121,7 +1121,7 @@ class AuthnResponse(StatusResponse):
raise StatusInvalidAuthnResponseStatement(
"The Authn Response Statement is not valid"
)
-
+
def __str__(self):
return self.xmlstr
diff --git a/tests/test_41_response.py b/tests/test_41_response.py
index 54f68c47..9380ae10 100644
--- a/tests/test_41_response.py
+++ b/tests/test_41_response.py
@@ -48,37 +48,37 @@ class TestResponse:
self._resp_ = server.create_authn_response(
IDENTITY,
- "id12", # in_response_to
- "http://lingon.catalogix.se:8087/",
- # consumer_url
- "urn:mace:example.com:saml:roland:sp",
- # sp_entity_id
- name_id=name_id)
+ in_response_to="id12",
+ destination="http://lingon.catalogix.se:8087/",
+ sp_entity_id="urn:mace:example.com:saml:roland:sp",
+ name_id=name_id,
+ )
self._sign_resp_ = server.create_authn_response(
IDENTITY,
- "id12", # in_response_to
- "http://lingon.catalogix.se:8087/", # consumer_url
- "urn:mace:example.com:saml:roland:sp", # sp_entity_id
+ in_response_to="id12",
+ destination="http://lingon.catalogix.se:8087/",
+ sp_entity_id="urn:mace:example.com:saml:roland:sp",
name_id=name_id,
- sign_assertion=True)
+ sign_assertion=True,
+ )
self._resp_authn = server.create_authn_response(
IDENTITY,
- "id12", # in_response_to
- "http://lingon.catalogix.se:8087/", # consumer_url
- "urn:mace:example.com:saml:roland:sp", # sp_entity_id
+ in_response_to="id12",
+ destination="http://lingon.catalogix.se:8087/",
+ sp_entity_id="urn:mace:example.com:saml:roland:sp",
name_id=name_id,
- authn=AUTHN)
+ authn=AUTHN,
+ )
self._resp_issuer_none = server.create_authn_response(
IDENTITY,
- "id12", # in_response_to
- "http://lingon.catalogix.se:8087/",
- # consumer_url
- "urn:mace:example.com:saml:roland:sp",
- # sp_entity_id
- name_id=name_id)
+ in_response_to="id12",
+ destination="http://lingon.catalogix.se:8087/",
+ sp_entity_id="urn:mace:example.com:saml:roland:sp",
+ name_id=name_id,
+ )
self._resp_issuer_none.issuer = None
conf = config.SPConfig()
@@ -87,36 +87,41 @@ class TestResponse:
def test_1(self):
xml_response = ("%s" % (self._resp_,))
- resp = response_factory(xml_response, self.conf,
- return_addrs=[
- "http://lingon.catalogix.se:8087/"],
- outstanding_queries={
- "id12": "http://localhost:8088/sso"},
- timeslack=TIMESLACK, decode=False)
+ resp = response_factory(
+ xml_response, self.conf,
+ return_addrs=["http://lingon.catalogix.se:8087/"],
+ outstanding_queries={"id12": "http://localhost:8088/sso"},
+ timeslack=TIMESLACK,
+ decode=False,
+ )
assert isinstance(resp, StatusResponse)
assert isinstance(resp, AuthnResponse)
def test_2(self):
xml_response = self._sign_resp_
- resp = response_factory(xml_response, self.conf,
- return_addrs=[
- "http://lingon.catalogix.se:8087/"],
- outstanding_queries={
- "id12": "http://localhost:8088/sso"},
- timeslack=TIMESLACK, decode=False)
+ resp = response_factory(
+ xml_response,
+ self.conf,
+ return_addrs=["http://lingon.catalogix.se:8087/"],
+ outstanding_queries={"id12": "http://localhost:8088/sso"},
+ timeslack=TIMESLACK,
+ decode=False,
+ )
assert isinstance(resp, StatusResponse)
assert isinstance(resp, AuthnResponse)
def test_issuer_none(self):
xml_response = ("%s" % (self._resp_issuer_none,))
- resp = response_factory(xml_response, self.conf,
- return_addrs=[
- "http://lingon.catalogix.se:8087/"],
- outstanding_queries={
- "id12": "http://localhost:8088/sso"},
- timeslack=TIMESLACK, decode=False)
+ resp = response_factory(
+ xml_response,
+ self.conf,
+ return_addrs=["http://lingon.catalogix.se:8087/"],
+ outstanding_queries={"id12": "http://localhost:8088/sso"},
+ timeslack=TIMESLACK,
+ decode=False,
+ )
assert isinstance(resp, StatusResponse)
assert isinstance(resp, AuthnResponse)