MCPcopy Create free account
hub / github.com/pyinvoke/invoke / cd_should_accept_any_stringable_object

Method cd_should_accept_any_stringable_object

tests/context.py:213–228  ·  view source on GitHub ↗
(self, Local)

Source from the content-addressed store, hash-verified

211
212 @patch(local_path)
213 def cd_should_accept_any_stringable_object(self, Local):
214 class Path:
215 def __init__(self, value):
216 self.value = value
217
218 def __str__(self):
219 return self.value
220
221 runner = Local.return_value
222 c = Context()
223
224 with c.cd(Path("foo")):
225 c.run("whoami")
226
227 cmd = "cd foo && whoami"
228 assert runner.run.call_args[0][0] == cmd
229
230 class prefix:
231 @patch(local_path)

Callers

nothing calls this directly

Calls 4

cdMethod · 0.95
runMethod · 0.95
ContextClass · 0.90
PathClass · 0.85

Tested by

no test coverage detected