Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add notation plugin uninstall command #842

Merged
merged 24 commits into from
Dec 5, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
notation plugin uninstall
Signed-off-by: Patrick Zheng <[email protected]>
Two-Hearts committed Nov 28, 2023
commit ce884813073e61a77c826f129c4002c09a9f6084
25 changes: 25 additions & 0 deletions cmd/notation/internal/plugin/plugin_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package plugin

import (
"context"
"runtime"
"testing"

"github.com/notaryproject/notation-go/dir"
)

func TestCheckPluginExistence(t *testing.T) {
dir.UserConfigDir = "testdata"
if runtime.GOOS == "windows" {
t.Skip("skipping test on Windows")
}
exist, err := CheckPluginExistence(context.Background(), "non-exist-plugin")
if exist || err != nil {
t.Fatalf("expected exist to be false with nil err, got: %v, %s", exist, err)
}

exist, err = CheckPluginExistence(context.Background(), "test-plugin")
if !exist || err != nil {
t.Fatalf("expected exist to be true with nil err, got: %v, %s", exist, err)
}
}
Empty file.