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

Method prefixes_command_with_sudo

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

Source from the content-addressed store, hash-verified

295 class sudo:
296 @patch(local_path)
297 def prefixes_command_with_sudo(self, Local):
298 runner = Local.return_value
299 Context().sudo("whoami")
300 # NOTE: implicitly tests default sudo.prompt conf value
301 cmd = "sudo -S -p '[sudo] password: ' whoami"
302 assert runner.run.called, "sudo() never called runner.run()!"
303 assert runner.run.call_args[0][0] == cmd
304
305 @patch(local_path)
306 def optional_user_argument_adds_u_and_H_flags(self, Local):

Callers

nothing calls this directly

Calls 2

ContextClass · 0.90
sudoMethod · 0.45

Tested by

no test coverage detected