File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -62,13 +62,16 @@ def _expect_sign_failure(self):
6262 with self .assertRaisesRegex (xmlsec .Error , 'failed to sign' ):
6363 self ._sign_doc ()
6464
65- def _register_mismatch_callbacks (self , match_cb = lambda filename : False ):
66- xmlsec . register_callbacks (
65+ def _mismatch_callbacks (self , match_cb = lambda filename : False ):
66+ return [
6767 match_cb ,
6868 lambda filename : None ,
6969 lambda none , buf : 0 ,
7070 lambda none : None ,
71- )
71+ ]
72+
73+ def _register_mismatch_callbacks (self , match_cb = lambda filename : False ):
74+ xmlsec .register_callbacks (* self ._mismatch_callbacks (match_cb ))
7275
7376 def _register_match_callbacks (self ):
7477 xmlsec .register_callbacks (
@@ -147,3 +150,9 @@ def mismatch_cb(filename):
147150 self ._register_mismatch_callbacks (mismatch_cb )
148151 self ._expect_sign_failure ()
149152 self .assertEqual (mismatch_calls , 2 )
153+
154+ def test_register_non_callables (self ):
155+ for idx in range (4 ):
156+ cbs = self ._mismatch_callbacks ()
157+ cbs [idx ] = None
158+ self .assertRaises (TypeError , xmlsec .register_callbacks , * cbs )
You can’t perform that action at this time.
0 commit comments