File tree Expand file tree Collapse file tree 3 files changed +7
-1
lines changed
Expand file tree Collapse file tree 3 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -485,7 +485,6 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
485485 PYXMLSEC_ADD_TRANSFORM_CONSTANT (TransformXPath , "XPATH" );
486486 PYXMLSEC_ADD_TRANSFORM_CONSTANT (TransformXPath2 , "XPATH2" );
487487 PYXMLSEC_ADD_TRANSFORM_CONSTANT (TransformXPointer , "XPOINTER" );
488- PYXMLSEC_ADD_TRANSFORM_CONSTANT (TransformXslt , "XSLT" );
489488 PYXMLSEC_ADD_TRANSFORM_CONSTANT (TransformRemoveXmlTagsC14N , "REMOVE_XML_TAGS_C14N" );
490489 PYXMLSEC_ADD_TRANSFORM_CONSTANT (TransformVisa3DHack , "VISA3D_HACK" );
491490
@@ -502,6 +501,9 @@ int PyXmlSec_ConstantsModule_Init(PyObject* package) {
502501#ifndef XMLSEC_NO_DSA
503502 PYXMLSEC_ADD_TRANSFORM_CONSTANT (TransformDsaSha1 , "DSA_SHA1" );
504503#endif
504+ #ifndef XMLSEC_NO_XSLT
505+ PYXMLSEC_ADD_TRANSFORM_CONSTANT (TransformXslt , "XSLT" );
506+ #endif
505507
506508#if XMLSEC_VERSION_HEX > 0x10212
507509 // from version 1.2.19
Original file line number Diff line number Diff line change 1+ import unittest
12import xmlsec
23from tests import base
34
@@ -194,6 +195,7 @@ def test_sign_binary_no_key(self):
194195 with self .assertRaisesRegex (xmlsec .Error , 'Sign key is not specified.' ):
195196 ctx .sign_binary (bytes = b'' , transform = consts .TransformRsaSha1 )
196197
198+ @unittest .skipIf (not hasattr (consts , 'TransformXslt' ), reason = 'XSLT transformations not enabled' )
197199 def test_sign_binary_invalid_signature_method (self ):
198200 ctx = xmlsec .SignatureContext ()
199201 ctx .key = xmlsec .Key .from_file (self .path ("rsakey.pem" ), format = consts .KeyDataFormatPem )
Original file line number Diff line number Diff line change 1+ import unittest
12from lxml import etree
23
34import xmlsec
@@ -195,6 +196,7 @@ def test_encrypted_data_ensure_key_info_bad_args(self):
195196 with self .assertRaises (TypeError ):
196197 xmlsec .template .encrypted_data_ensure_key_info ('' )
197198
199+ @unittest .skipIf (not hasattr (consts , 'TransformXslt' ), reason = 'XSLT transformations not enabled' )
198200 def test_transform_add_c14n_inclusive_namespaces (self ):
199201 root = self .load_xml ("doc.xml" )
200202 sign = xmlsec .template .create (root , c14n_method = consts .TransformExclC14N , sign_method = consts .TransformRsaSha1 )
You can’t perform that action at this time.
0 commit comments