summaryrefslogtreecommitdiff
path: root/tests/test_20_assertion.py
diff options
context:
space:
mode:
authorrohe <roland.hedberg@adm.umu.se>2016-04-16 14:05:15 +0200
committerrohe <roland.hedberg@adm.umu.se>2016-04-16 14:05:15 +0200
commit9c04dc7ebbae1791b4234bc0f4f2949f1fe9f3c4 (patch)
tree622b1f73986f32ddc8dcad2ad462613a563538c1 /tests/test_20_assertion.py
parent9e25cc73728e67cdafe07850566796ba0ce81473 (diff)
downloadpysaml2-9c04dc7ebbae1791b4234bc0f4f2949f1fe9f3c4.tar.gz
Fixed bug due to the refactoring.
Diffstat (limited to 'tests/test_20_assertion.py')
-rw-r--r--tests/test_20_assertion.py55
1 files changed, 34 insertions, 21 deletions
diff --git a/tests/test_20_assertion.py b/tests/test_20_assertion.py
index 1e656ea7..f04883dd 100644
--- a/tests/test_20_assertion.py
+++ b/tests/test_20_assertion.py
@@ -1,6 +1,7 @@
# coding=utf-8
import pytest
+from saml2.argtree import add_path
from saml2.authn_context import pword
from saml2.mdie import to_dict
from saml2 import md, assertion
@@ -810,16 +811,21 @@ def test_assertion_with_noop_attribute_conv():
})
name_id = NameID(format=NAMEID_FORMAT_TRANSIENT, text="foobar")
issuer = Issuer(text="entityid", format=NAMEID_FORMAT_ENTITY)
- subject_confirmation_specs = {
- 'recipient': 'consumer_url',
- 'in_response_to': 'in_response_to',
- 'subject_confirmation_method': saml.SCM_BEARER
- }
+
+ farg = add_path(
+ {},
+ ['subject', 'subject_confirmation', 'method', saml.SCM_BEARER])
+ add_path(
+ farg['subject']['subject_confirmation'],
+ ['subject_confirmation_data', 'in_response_to', 'in_response_to'])
+ add_path(
+ farg['subject']['subject_confirmation'],
+ ['subject_confirmation_data', 'recipient', 'consumer_url'])
+
msg = ast.construct(
"sp_entity_id", [AttributeConverterNOOP(NAME_FORMAT_URI)], policy,
- issuer=issuer, authn_decl=ACD, name_id=name_id,
- authn_auth="authn_authn",
- subject_confirmation_specs=subject_confirmation_specs)
+ issuer=issuer, farg=farg, authn_decl=ACD, name_id=name_id,
+ authn_auth="authn_authn")
print(msg)
for attr in msg.attribute_statement[0].attribute:
@@ -864,16 +870,20 @@ def test_assertion_with_zero_attributes():
})
name_id = NameID(format=NAMEID_FORMAT_TRANSIENT, text="foobar")
issuer = Issuer(text="entityid", format=NAMEID_FORMAT_ENTITY)
- subject_confirmation_specs = {
- 'recipient': 'consumer_url',
- 'in_response_to': 'in_response_to',
- 'subject_confirmation_method': saml.SCM_BEARER
- }
+ farg = add_path(
+ {},
+ ['subject', 'subject_confirmation', 'method', saml.SCM_BEARER])
+ add_path(
+ farg['subject']['subject_confirmation'],
+ ['subject_confirmation_data', 'in_response_to', 'in_response_to'])
+ add_path(
+ farg['subject']['subject_confirmation'],
+ ['subject_confirmation_data', 'recipient', 'consumer_url'])
msg = ast.construct(
"sp_entity_id", [AttributeConverterNOOP(NAME_FORMAT_URI)], policy,
issuer=issuer, authn_decl=ACD, authn_auth="authn_authn",
- name_id=name_id, subject_confirmation_specs=subject_confirmation_specs)
+ name_id=name_id, farg=farg)
print(msg)
assert msg.attribute_statement == []
@@ -892,17 +902,20 @@ def test_assertion_with_authn_instant():
name_id = NameID(format=NAMEID_FORMAT_TRANSIENT, text="foobar")
issuer = Issuer(text="entityid", format=NAMEID_FORMAT_ENTITY)
- subject_confirmation_specs = {
- 'recipient': 'consumer_url',
- 'in_response_to': 'in_response_to',
- 'subject_confirmation_method': saml.SCM_BEARER
- }
+ farg = add_path(
+ {},
+ ['subject', 'subject_confirmation', 'method', saml.SCM_BEARER])
+ add_path(
+ farg['subject']['subject_confirmation'],
+ ['subject_confirmation_data', 'in_response_to', 'in_response_to'])
+ add_path(
+ farg['subject']['subject_confirmation'],
+ ['subject_confirmation_data', 'recipient', 'consumer_url'])
msg = ast.construct(
"sp_entity_id", [AttributeConverterNOOP(NAME_FORMAT_URI)], policy,
issuer=issuer, authn_decl=ACD, authn_auth="authn_authn",
- authn_instant=1234567890, name_id=name_id,
- subject_confirmation_specs=subject_confirmation_specs)
+ authn_instant=1234567890, name_id=name_id, farg=farg)
print(msg)
assert msg.authn_statement[0].authn_instant == "2009-02-13T23:31:30Z"