MCPcopy Create free account
hub / github.com/datacamp/pythonwhat / test_run_solution_dir

Function test_run_solution_dir

tests/test_local.py:124–143  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

122
123
124def test_run_solution_dir():
125 code = 'from pathlib import Path; c = Path("c").read_text(encoding="utf-8")'
126
127 file_dir = "a/b"
128 file_path = "a/b/c"
129 workspace_location = "workspace"
130
131 with in_temp_dir():
132 write_file("solution/" + file_dir, "c", code)
133
134 os.makedirs(workspace_location)
135 with ChDir(workspace_location):
136 write_file(file_dir, "c", code)
137
138 chain = setup_state("", "", pec="")
139
140 child = chain.check_file(file_path, solution_code=code)
141
142 child.run(file_dir).check_object("c")
143 child.run().check_object("c")
144
145
146def test_run_with_absolute_dir():

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