mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-27 07:18:28 +01:00
machine: add dvc machine ssh (#6501)
* machine: add naive asyncssh shell client * machine: add `dvc machine ssh` command * add ssh requirements to terraform install extras * update asyncssh comments * fix py <3.7 * fix async mocking in py<3.8 * use mock instead of unittest.mock
This commit is contained in:
@@ -6,6 +6,7 @@ from dvc.command.machine import (
|
||||
CmdMachineCreate,
|
||||
CmdMachineDestroy,
|
||||
CmdMachineRemove,
|
||||
CmdMachineSsh,
|
||||
)
|
||||
|
||||
|
||||
@@ -64,3 +65,16 @@ def test_destroy(tmp_dir, dvc, mocker):
|
||||
|
||||
assert cmd.run() == 0
|
||||
m.assert_called_once_with("foo")
|
||||
|
||||
|
||||
def test_ssh(tmp_dir, dvc, mocker):
|
||||
cli_args = parse_args(["machine", "ssh", "foo"])
|
||||
assert cli_args.func == CmdMachineSsh
|
||||
|
||||
cmd = cli_args.func(cli_args)
|
||||
m = mocker.patch.object(
|
||||
cmd.repo.machine, "run_shell", autospec=True, return_value=0
|
||||
)
|
||||
|
||||
assert cmd.run() == 0
|
||||
m.assert_called_once_with("foo")
|
||||
|
||||
Reference in New Issue
Block a user