mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-12-03 07:18:28 +01:00
machine: Add a new command dvc machine status (#6649)
* machine: Add a new command `dvc machine status` fix#6482 1. add a new command `dvc machien status` 2. add a unit test for the cli call. 3. add a unit test for the shown result. * Update dvc/command/machine.py Co-authored-by: Saugat Pachhai <[email protected]> * Update dvc/command/machine.py Co-authored-by: Saugat Pachhai <[email protected]> * Update machine.py * Remove sensitive fields * Update dvc/machine/__init__.py Co-authored-by: Casper da Costa-Luis <[email protected]> * Update tests/func/machine/__init__.py Co-authored-by: Casper da Costa-Luis <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Use white list to limit shown fields Co-authored-by: Saugat Pachhai <[email protected]> Co-authored-by: Casper da Costa-Luis <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
Saugat Pachhai
Casper da Costa-Luis
pre-commit-ci[bot]
parent
6d96ecb376
commit
966dc8a1ca
@@ -9,6 +9,7 @@ from dvc.command.machine import (
|
||||
CmdMachineModify,
|
||||
CmdMachineRemove,
|
||||
CmdMachineSsh,
|
||||
CmdMachineStatus,
|
||||
)
|
||||
|
||||
DATA = {
|
||||
@@ -56,6 +57,19 @@ def test_create(tmp_dir, dvc, mocker):
|
||||
m.assert_called_once_with("foo")
|
||||
|
||||
|
||||
def test_status(tmp_dir, dvc, mocker):
|
||||
cli_args = parse_args(["machine", "status", "foo"])
|
||||
assert cli_args.func == CmdMachineStatus
|
||||
|
||||
cmd = cli_args.func(cli_args)
|
||||
m = mocker.patch.object(
|
||||
cmd.repo.machine, "status", autospec=True, return_value=[]
|
||||
)
|
||||
|
||||
assert cmd.run() == 0
|
||||
m.assert_called_once_with("foo")
|
||||
|
||||
|
||||
def test_destroy(tmp_dir, dvc, mocker):
|
||||
cli_args = parse_args(["machine", "destroy", "foo"])
|
||||
assert cli_args.func == CmdMachineDestroy
|
||||
|
||||
Reference in New Issue
Block a user