Skip to content

Commit 3b6d161

Browse files
committed
fix bug in test scripts
1 parent c15575f commit 3b6d161

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/PrecisionProDB_test.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def run_command(command):
2020
else:
2121
return command, 'completed'
2222

23-
def get_cmd_to_run(key_input, key_variant, sqlite_key):
23+
def get_cmd_to_run(key_input, key_variant, sqlite_key, output_test, dc_variant, dc_inputs, path_of_precisionprodb):
2424
'''
2525
'''
2626
if key_input == 'UniProt' and key_variant != 'str':
@@ -29,6 +29,7 @@ def get_cmd_to_run(key_input, key_variant, sqlite_key):
2929
else:
3030
cmd_UniProt = ' -t 4 '
3131

32+
folder_output_dir = ''
3233
folder_work = os.path.join(output_test, key_input, key_variant, sqlite_key)
3334
if not os.path.exists(folder_work):
3435
os.makedirs(folder_work)
@@ -59,7 +60,7 @@ def get_cmd_to_run(key_input, key_variant, sqlite_key):
5960

6061
return cmd
6162

62-
def main(dc_variant, dc_inputs, dc_sqlite, output_test):
63+
def main_test(dc_variant, dc_inputs, dc_sqlite, output_test, path_of_precisionprodb):
6364

6465
ls_cmd = []
6566
ls_results = []
@@ -68,7 +69,7 @@ def main(dc_variant, dc_inputs, dc_sqlite, output_test):
6869
for sqlite_key in dc_sqlite:
6970
if sqlite_key == 'no_sqlite' and key_variant == 'str':
7071
continue
71-
cmd = get_cmd_to_run(key_input, key_variant, sqlite_key)
72+
cmd = get_cmd_to_run(key_input, key_variant, sqlite_key, output_test, dc_variant, dc_inputs, path_of_precisionprodb)
7273
ls_cmd.append(cmd)
7374
ls_results.append(run_command(cmd))
7475

@@ -107,6 +108,8 @@ def main():
107108
output_test = (
108109
args.output if args.output else os.path.join(path_of_precisionprodb, "test_output")
109110
)
111+
if not os.path.isabs(output_test):
112+
output_test = os.path.abspath(output_test)
110113

111114
print(f"PATH_OF_PRECISIONPRODB: {path_of_precisionprodb}")
112115
print(f"OUTPUT_TEST: {output_test}")
@@ -156,7 +159,7 @@ def main():
156159
'sqlite_two_step': ''
157160
}
158161

159-
main(dc_variant, dc_inputs, dc_sqlite, output_test)
162+
main_test(dc_variant, dc_inputs, dc_sqlite, output_test, path_of_precisionprodb)
160163

161164

162165
if __name__ == '__main__':

0 commit comments

Comments
 (0)