MCPcopy Create free account
hub / github.com/catid/supercharger / copy_candidate_scripts

Function copy_candidate_scripts

codegen/codegen.py:82–91  ·  view source on GitHub ↗
(source_dir, function_name, code_id, test_id)

Source from the content-addressed store, hash-verified

80 f.write(code)
81
82def 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))
84 code_dest_path = os.path.join(source_dir, function_name, get_script_name_from_function_name(function_name, is_test=False))
85
86 test_source_path = os.path.join(source_dir, function_name, get_script_name_from_function_name(function_name, is_test=True, variation=test_id))
87 test_dest_path = os.path.join(source_dir, function_name, get_script_name_from_function_name(function_name, is_test=True))
88
89 # Copy files
90 shutil.copyfile(code_source_path, code_dest_path)
91 shutil.copyfile(test_source_path, test_dest_path)
92
93def copy_and_run_pytest(source_dir, function_name, code_id, test_id, executor):
94 copy_candidate_scripts(source_dir, function_name, code_id, test_id)

Callers 2

copy_and_run_pytestFunction · 0.85
write_codeMethod · 0.85

Calls 1

Tested by

no test coverage detected