File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,35 @@ def test_gifti_image():
2626 gi = GiftiImage ()
2727 assert_equal (gi .darrays , [])
2828
29+ # Test darrays / numDA
30+ gi = GiftiImage ()
31+ assert_equal (gi .numDA , 0 )
32+
33+ da = GiftiDataArray (data = 'data' )
34+ gi .add_gifti_data_array (da )
35+ assert_equal (gi .numDA , 1 )
36+ assert_equal (gi .darrays [0 ].data , 'data' )
37+
38+ gi .remove_gifti_data_array (0 )
39+ assert_equal (gi .numDA , 0 )
40+
41+ # Remove from empty
42+ gi = GiftiImage ()
43+ gi .remove_gifti_data_array_by_intent (0 )
44+ assert_equal (gi .numDA , 0 )
45+
46+ # Remove one
47+ gi = GiftiImage ()
48+ da = GiftiDataArray (data = 'data' )
49+ gi .add_gifti_data_array (da )
50+
51+ gi .remove_gifti_data_array_by_intent (0 )
52+ assert_equal (gi .numDA , 1 )
53+
54+ gi .darrays [0 ].intent = 0
55+ gi .remove_gifti_data_array_by_intent (0 )
56+ assert_equal (gi .numDA , 0 )
57+
2958
3059def test_dataarray ():
3160 for dt_code in data_type_codes .value_set ():
You can’t perform that action at this time.
0 commit comments