File tree Expand file tree Collapse file tree 1 file changed +17
-2
lines changed
Expand file tree Collapse file tree 1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change 11import copy
22from saml2 .config import SPConfig
3- from saml2 .metadata import entity_descriptor
3+ from saml2 .metadata import create_metadata_string , entity_descriptor
44from saml2 .saml import NAME_FORMAT_URI , NAME_FORMAT_BASIC
5+ from saml2 import sigver
6+
7+ from pathutils import full_path
58
69__author__ = 'roland'
710
@@ -47,5 +50,17 @@ def test_requested_attribute_name_format():
4750 assert req_attr .name_format == NAME_FORMAT_BASIC
4851
4952
53+ def test_signed_metadata_proper_str_bytes_handling ():
54+ sp_conf_2 = sp_conf .copy ()
55+ sp_conf_2 ['key_file' ] = full_path ("test.key" )
56+ sp_conf_2 ['cert_file' ] = full_path ("inc-md-cert.pem" )
57+ # requires xmlsec binaries per https://pysaml2.readthedocs.io/en/latest/examples/sp.html
58+ sp_conf_2 ['xmlsec_binary' ] = sigver .get_xmlsec_binary (["/opt/local/bin" ])
59+ cnf = SPConfig ().load (sp_conf_2 , metadata_construction = True )
60+
61+ # This will raise TypeError if string/bytes handling is not correct
62+ sp_metadata = create_metadata_string ('' , config = cnf , sign = True )
63+
64+
5065if __name__ == '__main__' :
51- test_requested_attribute_name_format ()
66+ test_requested_attribute_name_format ()
You can’t perform that action at this time.
0 commit comments