File tree Expand file tree Collapse file tree 1 file changed +24
-0
lines changed
tests/src/OneLogin/saml2_tests Expand file tree Collapse file tree 1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change 33
44import json
55import unittest
6+ import xmlsec
67
78from base64 import b64decode
89from lxml import etree
@@ -32,6 +33,29 @@ def file_contents(self, filename):
3233 f .close ()
3334 return content
3435
36+ def testLibxml2 (self ):
37+ """
38+ Tests that libxml2 versions used by xmlsec and lxml are compatible
39+
40+ If this test fails, reinstall lxml without using binary to ensure it is
41+ linked to same version of libxml2 as xmlsec:
42+ pip install --force-reinstall --no-binary lxml lxml
43+
44+ See https://bugs.launchpad.net/lxml/+bug/1960668
45+ """
46+ env = etree .fromstring ('<xml></xml>' )
47+ sig = xmlsec .template .create (
48+ env ,
49+ xmlsec .Transform .EXCL_C14N ,
50+ xmlsec .Transform .RSA_SHA256 ,
51+ ns = "ds"
52+ )
53+
54+ ds = etree .QName (sig ).namespace
55+ cm = sig .find (".//{%s}CanonicalizationMethod" % ds )
56+
57+ self .assertIsNotNone (cm )
58+
3559 def testValidateXML (self ):
3660 """
3761 Tests the validate_xml method of the OneLogin_Saml2_XML
You can’t perform that action at this time.
0 commit comments