@@ -55,17 +55,14 @@ def test_TraitedSpec_tab_completion():
5555 bet_nd = Node (fsl .BET (), name = 'bet' )
5656 bet_interface = fsl .BET ()
5757 bet_inputs = bet_nd .inputs .class_editable_traits ()
58- bet_outputs = bet_nd .outputs .class_editable_traits ()
58+ bet_outputs = bet_nd .outputs .class_editable_traits ()
5959
6060 # Check __all__ for bet node and interface inputs
61- assert bet_nd .inputs .__all__ == [
62- x for x in bet_inputs if not x == "__all__" ]
63- assert bet_interface .inputs .__all__ == [
64- x for x in bet_inputs if not x == "__all__" ]
61+ assert bet_nd .inputs .__all__ == bet_inputs
62+ assert bet_interface .inputs .__all__ == bet_inputs
6563
6664 # Check __all__ for bet node outputs
67- assert bet_nd .outputs .__all__ == [
68- x for x in bet_outputs if not x == "__all__" ]
65+ assert bet_nd .outputs .__all__ == bet_outputs
6966
7067
7168@pytest .mark .skip
@@ -91,20 +88,26 @@ def test_DynamicTraitedSpec_tab_completion():
9188 func_interface = Function (input_names = ["list_out" ],
9289 output_names = ["out_file" ,"another_file" ],
9390 function = extract_func )
94- # Check __all__ for interface inputs
95- assert func_interface .inputs .__all__ == func_interface ._input_names
96-
9791 # Define node
9892 list_extract = Node (Function (
9993 input_names = ["list_out" ],output_names = ["out_file" ],
10094 function = extract_func ), name = "list_extract" )
10195
96+ # Check __all__ for interface inputs
97+ expected_input = sorted (list_extract .inputs .editable_traits ())
98+ assert (sorted (func_interface .inputs .__all__ ) == expected_input )
99+
102100 # Check __all__ for node inputs
103- assert list_extract .inputs .__all__ == list_extract ._interface ._input_names
101+ assert (sorted (list_extract .inputs .__all__ ) == expected_input )
102+
104103 # Check __all__ for node outputs
105- outputs_dict = list_extract ._interface ._outputs ().get ().items ()
106- outputs = [k for k ,v in outputs_dict if not k == "__all__" ]
107- assert list_extract .outputs .__all__ == outputs
104+ expected_output = sorted (list_extract .outputs .editable_traits ())
105+ assert (sorted (list_extract .outputs .__all__ ) == expected_output )
106+
107+ # Add trait and retest
108+ list_extract .outputs .add_trait ("added_out_trait" ,"val" )
109+ expected_output = sorted (['added_out_trait' ,* expected_output ])
110+ assert (sorted (list_extract .outputs .__all__ ) == expected_output )
108111
109112
110113def test_TraitedSpec_logic ():
0 commit comments