(code, sources_dirname, func_name, is_test=False, variation=0)
| 70 | print(f"Error deleting {py_file}: {e}") |
| 71 | |
| 72 | def write_script_to_disk(code, sources_dirname, func_name, is_test=False, variation=0): |
| 73 | # Create the directory if it doesn't exist |
| 74 | dir_path = os.path.join(sources_dirname, func_name) |
| 75 | os.makedirs(dir_path, exist_ok=True) |
| 76 | |
| 77 | # Write the script to the file |
| 78 | file_path = os.path.join(dir_path, get_script_name_from_function_name(func_name, is_test, variation)) |
| 79 | with open(file_path, "w") as f: |
| 80 | f.write(code) |
| 81 | |
| 82 | def copy_candidate_scripts(source_dir, function_name, code_id, test_id): |
| 83 | code_source_path = os.path.join(source_dir, function_name, get_script_name_from_function_name(function_name, is_test=False, variation=code_id)) |
no test coverage detected