1515from core .models import TestScope
1616
1717__test_files__ = "JSONTestFiles.txt"
18+ __data_files__ = "testData.txt"
1819
1920# tags
2021__RELEASE_TAG__ = 'release'
2324__REGULAR_TAG__ = 'regular'
2425
2526
26- def __create_test_json_list__ (test_folder , scope , test_files_path ):
27+ def __create_test_json_list__ (test_folder , scope , test_files_path , data_files_path ):
2728 """cretas files containing list of tests to execute for a given scope"""
2829 test_files = utils .rlist_files (test_folder , lambda f : f .endswith ('.json' ))
2930 test_list = []
31+ test_data = []
3032 scope = TestScope .init (scope )
3133 for test_path in test_files :
3234 with open (test_path , 'r' ) as test_file :
@@ -36,9 +38,33 @@ def __create_test_json_list__(test_folder, scope, test_files_path):
3638 if TestScope .compatibleN (scope , test ['frequency' ]):
3739 if test_path not in test_list :
3840 test_list .append (test_path )
41+ if 'inputs' in test :
42+ if 'input' in test ['inputs' ]:
43+ if test ['inputs' ]['input' ] not in test_data :
44+ test_data .append (test ['inputs' ]['input' ])
45+ if 'input1' in test ['inputs' ]:
46+ if test ['inputs' ]['input1' ] not in test_data :
47+ test_data .append (test ['inputs' ]['input1' ])
48+ if 'input2' in test ['inputs' ]:
49+ if test ['inputs' ]['input2' ] not in test_data :
50+ test_data .append (test ['inputs' ]['input2' ])
51+ if 'input3' in test ['inputs' ]:
52+ if test ['inputs' ]['input3' ] not in test_data :
53+ test_data .append (test ['inputs' ]['input3' ])
54+ if 'input4' in test ['inputs' ]:
55+ if test ['inputs' ]['input4' ] not in test_data :
56+ test_data .append (test ['inputs' ]['input4' ])
57+ if 'input5' in test ['inputs' ]:
58+ if test ['inputs' ]['input5' ] not in test_data :
59+ test_data .append (test ['inputs' ]['input5' ])
60+ if 'input6' in test ['inputs' ]:
61+ if test ['inputs' ]['input6' ] not in test_data :
62+ test_data .append (test ['inputs' ]['input6' ])
3963 # test_list += f'{test_path}\n'
4064 with open (test_files_path , 'w' ) as file :
4165 file .write ('\n ' .join (test_list ))
66+ with open (data_files_path , 'w' ) as file :
67+ file .write ('\n ' .join (test_data ))
4268 return True
4369
4470
@@ -73,8 +99,9 @@ def __main__():
7399 log .error ("output folder does not exist" )
74100 sys .exit (1 )
75101 json_test_files = os .path .join (args .output_folder , __test_files__ )
102+ data_file = os .path .join (args .output_folder , __data_files__ )
76103
77- if __create_test_json_list__ (args .test_folder , args .scope , json_test_files ):
104+ if __create_test_json_list__ (args .test_folder , args .scope , json_test_files , data_file ):
78105 log .success (f"filtered JSON created in { json_test_files } " )
79106
80107
0 commit comments