@@ -25,7 +25,8 @@ def setUp(self) -> None:
25
25
self .dag_path = os .path .join (temp_dir_path , json_file_name )
26
26
self .data_path = os .path .join (temp_dir_path , json_file_name )
27
27
self .json_class = JsonUtility ("logs.log" )
28
- self .input_dict_list = [{"name" : "test_input" , "type" : float , "distribution" : scipy .stats .uniform (0 , 1 )}]
28
+ self .example_distribution = scipy .stats .uniform (0 , 10 )
29
+ self .input_dict_list = [{"name" : "test_input" , "type" : float , "distribution" : self .example_distribution }]
29
30
self .output_dict_list = [{"name" : "test_output" , "type" : float }]
30
31
self .meta_dict_list = [{"name" : "test_meta" , "type" : float , "populate" : populate_example }]
31
32
self .json_class .set_variables (self .input_dict_list , self .output_dict_list , self .meta_dict_list )
@@ -37,16 +38,20 @@ def test_setting_paths(self):
37
38
self .assertEqual (self .json_class .data_path , Path (self .data_path ))
38
39
39
40
def test_set_inputs (self ):
40
- ctf_input = Input ("test_input" , float , scipy .stats .uniform (0 , 1 ))
41
- self .assertEqual (self .json_class .inputs , ctf_input )
41
+ ctf_input = [Input ("test_input" , float , self .example_distribution )]
42
+ self .assertEqual (ctf_input [0 ].name , self .json_class .inputs [0 ].name )
43
+ self .assertEqual (ctf_input [0 ].datatype , self .json_class .inputs [0 ].datatype )
44
+ self .assertEqual (ctf_input [0 ].distribution , self .json_class .inputs [0 ].distribution )
42
45
43
46
def test_set_outputs (self ):
44
- ctf_output = Output ("test_output" , float )
45
- self .assertEqual (self .json_class .outputs , ctf_output )
47
+ ctf_output = [Output ("test_output" , float )]
48
+ self .assertEqual (ctf_output [0 ].name , self .json_class .outputs [0 ].name )
49
+ self .assertEqual (ctf_output [0 ].datatype , self .json_class .outputs [0 ].datatype )
46
50
47
51
def test_set_metas (self ):
48
- ctf_meta = Input ("test_meta" , float , populate_example )
49
- self .assertEqual (self .json_class .metas , ctf_meta )
52
+ ctf_meta = [Meta ("test_meta" , float , populate_example )]
53
+ self .assertEqual (ctf_meta [0 ].name , self .json_class .metas [0 ].name )
54
+ self .assertEqual (ctf_meta [0 ].datatype , self .json_class .metas [0 ].datatype )
50
55
51
56
def tearDown (self ) -> None :
52
57
remove_temp_dir_if_existent ()
0 commit comments