@@ -140,17 +140,17 @@ def test_cifti2_label():
140
140
lb .label = 'Test'
141
141
lb .key = 0
142
142
assert lb .rgba == (0 , 0 , 0 , 0 )
143
- assert compare_xml_leaf (lb .to_xml ().decode ('utf-8' ), "<Label Key='0' Red='0' Green='0' Blue='0' Alpha='0'>Test</Label>" )
143
+ assert compare_xml_leaf (lb .to_xml ().decode ('utf-8' ),
144
+ "<Label Key='0' Red='0' Green='0' Blue='0' Alpha='0'>Test</Label>" )
144
145
145
146
lb .red = 0
146
147
lb .green = 0.1
147
148
lb .blue = 0.2
148
149
lb .alpha = 0.3
149
150
assert lb .rgba == (0 , 0.1 , 0.2 , 0.3 )
150
151
151
- assert compare_xml_leaf (
152
- lb .to_xml ().decode ('utf-8' ),
153
- "<Label Key='0' Red='0' Green='0.1' Blue='0.2' Alpha='0.3'>Test</Label>" )
152
+ assert compare_xml_leaf (lb .to_xml ().decode ('utf-8' ),
153
+ "<Label Key='0' Red='0' Green='0.1' Blue='0.2' Alpha='0.3'>Test</Label>" )
154
154
155
155
lb .red = 10
156
156
with pytest .raises (ci .Cifti2HeaderError ):
@@ -172,7 +172,7 @@ def test_cifti2_parcel():
172
172
pl .append_cifti_vertices (None )
173
173
174
174
with pytest .raises (ValueError ):
175
- ci .Cifti2Parcel (** { ' vertices' : [1 , 2 , 3 ]} )
175
+ ci .Cifti2Parcel (vertices = [1 , 2 , 3 ])
176
176
177
177
pl = ci .Cifti2Parcel (name = 'region' ,
178
178
voxel_indices_ijk = ci .Cifti2VoxelIndicesIJK ([[1 , 2 , 3 ]]),
@@ -296,10 +296,10 @@ def test_cifti2_voxelindicesijk():
296
296
# Don't know how to use remove with slice
297
297
del vi [:, 0 ]
298
298
with pytest .raises (ValueError ):
299
- vi [( 0 , 0 , 0 ) ]
299
+ vi [0 , 0 , 0 ]
300
300
301
301
with pytest .raises (ValueError ):
302
- vi [( 0 , 0 , 0 ) ] = 0
302
+ vi [0 , 0 , 0 ] = 0
303
303
304
304
assert vi .to_xml ().decode ('utf-8' ) == '<VoxelIndicesIJK>0 1 2\n 3 4 6</VoxelIndicesIJK>'
305
305
@@ -334,22 +334,22 @@ def test_matrixindicesmap():
334
334
del mim .volume
335
335
assert mim .volume is None
336
336
with pytest .raises (ValueError ):
337
- delattr ( mim , ' volume' )
337
+ del mim . volume
338
338
339
339
mim .volume = volume
340
340
assert mim .volume == volume
341
341
mim .volume = volume2
342
342
assert mim .volume == volume2
343
343
344
344
with pytest .raises (ValueError ):
345
- setattr ( mim , ' volume' , parcel )
345
+ mim . volume = parcel
346
346
347
347
348
348
def test_matrix ():
349
349
m = ci .Cifti2Matrix ()
350
350
351
- with pytest .raises (TypeError ):
352
- m ( setattr , ' metadata' , ci .Cifti2Parcel () )
351
+ with pytest .raises (ValueError ):
352
+ m . metadata = ci .Cifti2Parcel ()
353
353
354
354
with pytest .raises (TypeError ):
355
355
m [0 ] = ci .Cifti2Parcel ()
0 commit comments