Tests: Batch of GoConvey to Testify conversions (#27008)

This commit is contained in:
Emil Tullstedt
2020-08-14 14:43:25 +02:00
committed by GitHub
parent 7ad1e3663c
commit b68634fbb4
8 changed files with 289 additions and 264 deletions

View File

@@ -12,9 +12,13 @@ import (
var ls_getPlugins func(path string) []models.InstalledPlugin = services.GetLocalPlugins
var (
errMissingPathFlag = errors.New("missing path flag")
errNotDirectory = errors.New("plugin path is not a directory")
)
var validateLsCommand = func(pluginDir string) error {
if pluginDir == "" {
return errors.New("missing path flag")
return errMissingPathFlag
}
logger.Debug("plugindir: " + pluginDir + "\n")
@@ -24,7 +28,7 @@ var validateLsCommand = func(pluginDir string) error {
}
if !pluginDirInfo.IsDir() {
return errors.New("plugin path is not a directory")
return errNotDirectory
}
return nil