@@ -108,7 +108,7 @@ class LoadErrorTest(PipeLineTest):
108
108
# A File that does not exist must throw an error with fail_on_error=True
109
109
def test_fail_on_error_no_file (self ):
110
110
try :
111
- res , md = self .exec_pipeline (
111
+ res , _md = self .exec_pipeline (
112
112
f"""
113
113
- load fail_on_error True:
114
114
- { self .datadir } /file_that_does_not_exist.xml
@@ -126,7 +126,7 @@ def test_fail_on_error_no_file(self):
126
126
# A File that does not exist must throw an error with fail_on_error=True
127
127
def test_fail_on_error_no_file_url (self ):
128
128
try :
129
- res , md = self .exec_pipeline (
129
+ res , _md = self .exec_pipeline (
130
130
f"""
131
131
- load fail_on_error True:
132
132
- file://{ self .datadir } /file_that_does_not_exist.xml
@@ -145,7 +145,7 @@ def test_fail_on_error_no_file_url(self):
145
145
# Note: Due to load_url retries it takes 20s to complete this test
146
146
def test_fail_on_error_no_url (self ):
147
147
try :
148
- res , md = self .exec_pipeline (
148
+ res , _md = self .exec_pipeline (
149
149
"""
150
150
- load fail_on_error True:
151
151
- http://127.0.0.1/does_not_exist.xml
@@ -163,7 +163,7 @@ def test_fail_on_error_no_url(self):
163
163
# A file with invalid XML must throw an exception with fail_on_error True:
164
164
def test_fail_on_error_invalid_file (self ):
165
165
try :
166
- res , md = self .exec_pipeline (
166
+ res , _md = self .exec_pipeline (
167
167
f"""
168
168
- load fail_on_error True:
169
169
- { self .datadir } /metadata/test01.xml
@@ -181,7 +181,7 @@ def test_fail_on_error_invalid_file(self):
181
181
# A directory with a file with invalid metadata must throw an exception with fail_on_error True and filter_invalid False:
182
182
def test_fail_on_error_invalid_dir (self ):
183
183
try :
184
- res , md = self .exec_pipeline (
184
+ res , _md = self .exec_pipeline (
185
185
f"""
186
186
- load fail_on_error True filter_invalid False:
187
187
- { self .datadir } /metadata/
@@ -197,7 +197,7 @@ def test_fail_on_error_invalid_dir(self):
197
197
198
198
# A file with invalid XML must not throw an exception by default (fail_on_error False):
199
199
def test_no_fail_on_error_invalid_file (self ):
200
- res , md = self .exec_pipeline (
200
+ _res , md = self .exec_pipeline (
201
201
f"""
202
202
- load:
203
203
- { self .datadir } /metadata/test01.xml
@@ -212,7 +212,7 @@ def test_no_fail_on_error_invalid_file(self):
212
212
# Loading an xml file with an invalid entity must throw when filter_invalid False and fail_on_error True
213
213
def test_fail_on_error_invalid_entity (self ):
214
214
try :
215
- res , md = self .exec_pipeline (
215
+ res , _md = self .exec_pipeline (
216
216
f"""
217
217
- load fail_on_error True filter_invalid False:
218
218
- { self .datadir } /metadata/test01.xml
@@ -231,7 +231,7 @@ def test_fail_on_error_invalid_entity(self):
231
231
232
232
# Test default behaviour. Loading a file with an invalid entity must not raise an exception
233
233
def test_no_fail_on_error_invalid_entity (self ):
234
- res , md = self .exec_pipeline (
234
+ _res , md = self .exec_pipeline (
235
235
f"""
236
236
- load:
237
237
- { self .datadir } /metadata/test01.xml
@@ -245,7 +245,7 @@ def test_no_fail_on_error_invalid_entity(self):
245
245
246
246
# A directory with a file with invalid metadata must not throw by default:
247
247
def test_no_fail_on_error_invalid_dir (self ):
248
- res , md = self .exec_pipeline (
248
+ _res , md = self .exec_pipeline (
249
249
f"""
250
250
- load:
251
251
- { self .datadir } /metadata/
@@ -263,7 +263,7 @@ class SortTest(PipeLineTest):
263
263
EID3 = "https://sharav.abes.fr/idp/shibboleth"
264
264
265
265
@staticmethod
266
- def _run_sort_test (expected_order , sxp , res , l ):
266
+ def _run_sort_test (expected_order , sxp , res , output ):
267
267
if sxp is not None :
268
268
# Verify expected warnings for missing sort values
269
269
for e in expected_order :
@@ -275,11 +275,11 @@ def _run_sort_test(expected_order, sxp, res, l):
275
275
f"Sort pipe: unable to sort entity by '{ sxp } '. Entity '{ e [0 ]} ' has no such value"
276
276
)
277
277
try :
278
- assert keygen_fail_str in str (l )
278
+ assert keygen_fail_str in str (output )
279
279
except AssertionError :
280
280
print (
281
281
f"Test failed on expecting missing sort value from: '{ e [0 ]} '.\n "
282
- f"Could not find string on the output: '{ keygen_fail_str } '.\n Output was:\n { l } "
282
+ f"Could not find string on the output: '{ keygen_fail_str } '.\n Output was:\n { output } "
283
283
)
284
284
raise
285
285
except (IndexError , TypeError ):
@@ -308,7 +308,7 @@ def _run_sort_test(expected_order, sxp, res, l):
308
308
# Test sort by entityID only
309
309
def test_sort (self ):
310
310
sxp = None
311
- res , md = self .exec_pipeline (
311
+ res , _md = self .exec_pipeline (
312
312
f"""
313
313
- load:
314
314
- { self .datadir } /metadata/test01.xml
@@ -370,16 +370,16 @@ def test_sort_group(self):
370
370
class SigningTest (PipeLineTest ):
371
371
def test_signing (self ):
372
372
self .output = tempfile .NamedTemporaryFile ('w' ).name
373
- res , md , ctx = self .run_pipeline ("signer.fd" , self )
373
+ _res , md , _ctx = self .run_pipeline ("signer.fd" , self )
374
374
eIDs = [e .get ('entityID' ) for e in md .store ]
375
375
assert 'https://idp.aco.net/idp/shibboleth' in eIDs
376
376
assert 'https://skriptenforum.net/shibboleth' in eIDs
377
377
os .unlink (self .output )
378
378
379
379
def test_signing_and_validation (self ):
380
380
self .output = tempfile .NamedTemporaryFile ('w' ).name
381
- res_s , md_s , ctx_s = self .run_pipeline ("signer.fd" , self )
382
- res_v , md_v , ctx_v = self .run_pipeline ("validator.fd" , self )
381
+ _res_s , _md_s , _ctx_s = self .run_pipeline ("signer.fd" , self )
382
+ _res_v , md_v , _ctx_v = self .run_pipeline ("validator.fd" , self )
383
383
384
384
eIDs = [e .get ('entityID' ) for e in md_v .store ]
385
385
assert 'https://idp.aco.net/idp/shibboleth' in eIDs
@@ -388,7 +388,7 @@ def test_signing_and_validation(self):
388
388
389
389
def test_cert_report (self ):
390
390
self .output = tempfile .NamedTemporaryFile ('w' ).name
391
- res , md , ctx = self .run_pipeline ("certreport.fd" , self )
391
+ _res , md , _ctx = self .run_pipeline ("certreport.fd" , self )
392
392
eIDs = [e .get ('entityID' ) for e in md .store ]
393
393
assert 'https://idp.aco.net/idp/shibboleth' in eIDs
394
394
assert 'https://skriptenforum.net/shibboleth' in eIDs
@@ -398,7 +398,7 @@ def test_cert_report(self):
398
398
399
399
def test_cert_report_swamid (self ):
400
400
self .output = tempfile .NamedTemporaryFile ('w' ).name
401
- res , md , ctx = self .run_pipeline ("certreport-swamid.fd" , self )
401
+ _res , md , _ctx = self .run_pipeline ("certreport-swamid.fd" , self )
402
402
with open (self .output ) as fd :
403
403
print (fd .read ())
404
404
@@ -529,7 +529,7 @@ def test_prune(self):
529
529
finally :
530
530
try :
531
531
os .unlink (tmpfile )
532
- except :
532
+ except Exception :
533
533
pass
534
534
535
535
def test_empty_store (self ):
@@ -632,14 +632,14 @@ def test_pick_invalid(self):
632
632
finally :
633
633
try :
634
634
os .unlink (tmpfile )
635
- except :
635
+ except Exception :
636
636
pass
637
637
638
638
def test_blacklist_single_file (self ):
639
639
entity = 'https://idp.example.com/saml2/idp/metadata.php'
640
640
641
641
# First, load without a filter to ensure the entity is there
642
- res , md = self .exec_pipeline (
642
+ _res , md = self .exec_pipeline (
643
643
f"""
644
644
- when batch:
645
645
- load:
@@ -649,7 +649,7 @@ def test_blacklist_single_file(self):
649
649
assert md .lookup (entity )
650
650
651
651
# Then, load with a filter and ensure the entity isn't there anymore
652
- res , md = self .exec_pipeline (
652
+ _res , md = self .exec_pipeline (
653
653
f"""
654
654
- when batch:
655
655
- load:
@@ -670,7 +670,7 @@ def test_blacklist_directory(self):
670
670
entity = 'https://idp.example.com/saml2/idp/metadata.php'
671
671
672
672
# First, load without a filter to ensure the entity is there
673
- res , md = self .exec_pipeline (
673
+ _res , md = self .exec_pipeline (
674
674
f"""
675
675
- when batch:
676
676
- load:
@@ -680,7 +680,7 @@ def test_blacklist_directory(self):
680
680
assert md .lookup (entity )
681
681
682
682
# Then, load with a filter and ensure the entity isn't there anymore
683
- res , md = self .exec_pipeline (
683
+ _res , md = self .exec_pipeline (
684
684
f"""
685
685
- when batch:
686
686
- load:
@@ -695,7 +695,7 @@ def test_blacklist_directory(self):
695
695
696
696
def test_bad_namespace (self ):
697
697
try :
698
- res , md = self .exec_pipeline (
698
+ _res , _md = self .exec_pipeline (
699
699
f"""
700
700
- when batch:
701
701
- load:
@@ -710,7 +710,7 @@ def test_bad_namespace(self):
710
710
711
711
def test_parsecopy_ (self ):
712
712
entity = 'https://idp.example.com/saml2/idp/metadata.php'
713
- res , md = self .exec_pipeline (
713
+ _res , md = self .exec_pipeline (
714
714
f"""
715
715
- when batch:
716
716
- load:
0 commit comments