MCPcopy Index your code
hub / github.com/datacamp/pythonwhat / test_run_custom_solution_dir

Function test_run_custom_solution_dir

tests/test_local.py:173–192  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

171
172
173def test_run_custom_solution_dir():
174 code = 'from pathlib import Path; c = Path("c").read_text(encoding="utf-8")'
175
176 file_dir = "a/b"
177 file_path = "a/b/c"
178 custom_solution_location = "custom/solution/folder"
179
180 with in_temp_dir():
181 write_file(file_dir, "c", code)
182
183 os.makedirs(custom_solution_location)
184 with ChDir(custom_solution_location):
185 write_file(file_dir, "c", code)
186
187 chain = setup_state("", "", pec="")
188
189 child = chain.check_file(file_path, solution_code=code)
190
191 child.run(file_dir, solution_dir=custom_solution_location).check_object("c")
192 child.run(solution_dir=custom_solution_location).check_object("c")

Callers

nothing calls this directly

Calls 5

in_temp_dirFunction · 0.90
ChDirClass · 0.90
setup_stateFunction · 0.90
write_fileFunction · 0.85
runMethod · 0.80

Tested by

no test coverage detected