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

Method handle_test

codegen/codegen.py:222–246  ·  view source on GitHub ↗
(self, test_id, test, improved=False)

Source from the content-addressed store, hash-verified

220 self.manager.add_improve_code_job(code)
221
222 def handle_test(self, test_id, test, improved=False):
223 print(f"Task ID {test_id}: Generated test (improved={improved}) len={len(test)}")
224 #print("Test:", test)
225
226 self.tests.append(test_id)
227 self.contents[test_id] = test
228
229 write_script_to_disk(
230 test,
231 args.sources_dirname,
232 args.function_name,
233 is_test=True,
234 variation=test_id)
235
236 install_container_requirements(
237 args.sources_dirname,
238 args.function_name,
239 self.docker_execute)
240
241 for code_id in self.codes:
242 self.test_pair(code_id, test_id)
243
244 if not improved:
245 logging.info("Adding a job to improve the test with self-reflection")
246 self.manager.add_improve_test_job(test)
247
248 def handle_judge_pair(self, task_id, score):
249 (code_id, test_id, _) = self.pair_scores.get(task_id)

Callers 1

handle_resultsMethod · 0.95

Calls 4

test_pairMethod · 0.95
write_script_to_diskFunction · 0.85
add_improve_test_jobMethod · 0.80

Tested by

no test coverage detected