@@ -52,7 +52,7 @@ class spec(nib.TraitedSpec):
52
52
53
53
54
54
def test_TraitedSpec_tab_completion ():
55
- bet_nd = Node (fsl .BET (), name = 'bet' )
55
+ bet_nd = Node (fsl .BET (), name = 'bet' )
56
56
bet_interface = fsl .BET ()
57
57
bet_inputs = bet_nd .inputs .class_editable_traits ()
58
58
bet_outputs = bet_nd .outputs .class_editable_traits ()
@@ -87,28 +87,28 @@ def extract_func(list_out):
87
87
88
88
# Define interface
89
89
func_interface = Function (input_names = ["list_out" ],
90
- output_names = ["out_file" ,"another_file" ],
91
- function = extract_func )
90
+ output_names = ["out_file" , "another_file" ],
91
+ function = extract_func )
92
92
# Define node
93
93
list_extract = Node (Function (
94
- input_names = ["list_out" ],output_names = ["out_file" ],
94
+ input_names = ["list_out" ], output_names = ["out_file" ],
95
95
function = extract_func ), name = "list_extract" )
96
96
97
97
# Check __all__ for interface inputs
98
- expected_input = sorted (list_extract .inputs .editable_traits ())
99
- assert (sorted (func_interface .inputs .__all__ ) == expected_input )
98
+ expected_input = set (list_extract .inputs .editable_traits ())
99
+ assert (set (func_interface .inputs .__all__ ) == expected_input )
100
100
101
101
# Check __all__ for node inputs
102
- assert (sorted (list_extract .inputs .__all__ ) == expected_input )
102
+ assert (set (list_extract .inputs .__all__ ) == expected_input )
103
103
104
104
# Check __all__ for node outputs
105
- expected_output = sorted (list_extract .outputs .editable_traits ())
106
- assert (sorted (list_extract .outputs .__all__ ) == expected_output )
105
+ expected_output = set (list_extract .outputs .editable_traits ())
106
+ assert (set (list_extract .outputs .__all__ ) == expected_output )
107
107
108
108
# Add trait and retest
109
109
list_extract ._interface ._output_names .append ('added_out_trait' )
110
- expected_output = sorted ([ 'added_out_trait' , * expected_output ] )
111
- assert (sorted (list_extract .outputs .__all__ ) == expected_output )
110
+ expected_output . add ( 'added_out_trait' )
111
+ assert (set (list_extract .outputs .__all__ ) == expected_output )
112
112
113
113
114
114
def test_TraitedSpec_logic ():
0 commit comments