diff options
author | Roland Hedberg <roland.hedberg@adm.umu.se> | 2013-12-05 08:48:25 +0100 |
---|---|---|
committer | Roland Hedberg <roland.hedberg@adm.umu.se> | 2013-12-05 08:48:25 +0100 |
commit | c2701e9ba2c768d62dd54e171b51229a21135e83 (patch) | |
tree | 62e0952146bb4d9919549d1c6db8ea6187bac267 /tests | |
parent | 94b574c56a7c2fe5b03d7ca948823c4b8af9fb39 (diff) | |
download | pysaml2-c2701e9ba2c768d62dd54e171b51229a21135e83.tar.gz |
If no identity information refrain from constructing an AttributeStatement.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_20_assertion.py | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/tests/test_20_assertion.py b/tests/test_20_assertion.py index c9ce8ad3..460d4e5a 100644 --- a/tests/test_20_assertion.py +++ b/tests/test_20_assertion.py @@ -315,6 +315,7 @@ def test_assertion_2(): 'urn:oid:2.16.840.1.113730.3.1.241', 'urn:oid:0.9.2342.19200300.100.1.1']) + # ---------------------------------------------------------------------------- @@ -751,5 +752,26 @@ def test_filter_ava_5(): assert ava == {} +def test_assertion_with_zero_attributes(): + ava = {} + ast = Assertion(ava) + policy = Policy({ + "default": { + "lifetime": {"minutes": 240}, + "attribute_restrictions": None, # means all I have + "name_form": NAME_FORMAT_URI + }, + }) + name_id = NameID(format=NAMEID_FORMAT_TRANSIENT, text="foobar") + issuer = Issuer(text="entityid", format=NAMEID_FORMAT_ENTITY) + msg = ast.construct("sp_entity_id", "in_response_to", "consumer_url", + name_id, [AttributeConverterNOOP(NAME_FORMAT_URI)], + policy, issuer=issuer, authn_decl=ACD , + authn_auth="authn_authn") + + print msg + assert msg.attribute_statement == [] + + if __name__ == "__main__": - test_filter_ava_5()
\ No newline at end of file + test_assertion_with_zero_attributes()
\ No newline at end of file |