2121 Spm2AnalyzeImage , Spm99AnalyzeImage ,
2222 MGHImage , all_image_classes )
2323
24- from nose .tools import assert_true , assert_raises
24+ from nose .tools import assert_true
2525
2626DATA_PATH = pjoin (dirname (__file__ ), 'data' )
2727
@@ -46,17 +46,13 @@ def check_img(img_path, img_klass, sniff_mode, sniff, expect_success,
4646 msg ):
4747 """Embedded function to do the actual checks expected."""
4848
49- if sniff_mode == 'empty' and \
50- hasattr (img_klass .header_class , 'may_contain_header' ):
51- assert_raises (ValueError ,
52- img_klass .header_class .may_contain_header , sniff )
53-
5449 if sniff_mode == 'no_sniff' :
5550 # Don't pass any sniff--not even "None"
5651 is_img , new_sniff = img_klass .path_maybe_image (img_path )
5752 elif sniff_mode in ('empty' , 'irrelevant' , 'bad_sniff' ):
5853 # Add img_path to binaryblock sniff parameters
59- is_img , new_sniff = img_klass .path_maybe_image (img_path , (sniff , img_path ))
54+ is_img , new_sniff = img_klass .path_maybe_image (
55+ img_path , (sniff , img_path ))
6056 else :
6157 # Pass a sniff, but don't reuse across images.
6258 is_img , new_sniff = img_klass .path_maybe_image (img_path , sniff )
@@ -67,7 +63,8 @@ def check_img(img_path, img_klass, sniff_mode, sniff, expect_success,
6763 msg )
6864 expected_sizeof_hdr = getattr (img_klass .header_class ,
6965 'sizeof_hdr' , 0 )
70- current_sizeof_hdr = 0 if new_sniff is None else len (new_sniff [0 ])
66+ current_sizeof_hdr = 0 if new_sniff is None else \
67+ len (new_sniff [0 ])
7168 assert_true (current_sizeof_hdr >= expected_sizeof_hdr , new_msg )
7269
7370 # Check that the image type was recognized.
0 commit comments