Plugins: Tidy up CLI code (#67723)

* remove dead code and use pkg/plugins for uninstall process

* fix linter

* remove unnecessary cruft
This commit is contained in:
Will Browne
2023-05-04 10:52:09 +02:00
committed by GitHub
parent 3644ea6556
commit fd28c8490f
11 changed files with 25 additions and 74 deletions
@@ -43,8 +43,7 @@ func TestMissingPath(t *testing.T) {
c, err := commandstest.NewCliContext(tc.cliContext)
require.NoError(t, err)
cmd := Command{}
err = cmd.lsCommand(c)
err = lsCommand(c)
assert.Equal(t, tc.error, err)
})
}
@@ -66,8 +65,7 @@ func TestValidateLsCommand_override(t *testing.T) {
return expected
}
cmd := Command{}
err = cmd.lsCommand(c)
err = lsCommand(c)
assert.Error(t, err)
assert.Equal(t, expected, err, "can override validateLsCommand")
})
@@ -77,8 +75,7 @@ func TestValidateLsCommand_override(t *testing.T) {
c, err := commandstest.NewCliContext(map[string]string{"path": "/var/lib/grafana/plugins"})
require.NoError(t, err)
cmd := Command{}
err = cmd.lsCommand(c)
err = lsCommand(c)
assert.NotEqual(t, err, expected, "validateLsCommand is reset")
})
}