MCPcopy
hub / github.com/helm/helm / TestPluginVerifyCmd_KeyringFlag

Function TestPluginVerifyCmd_KeyringFlag

pkg/cmd/plugin_verify_test.go:139–165  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

137}
138
139func TestPluginVerifyCmd_KeyringFlag(t *testing.T) {
140 ensure.HelmHome(t)
141
142 // Create a plugin tarball with .prov file
143 pluginTgz := createTestPluginTarball(t)
144 defer os.Remove(pluginTgz)
145
146 // Create .prov file
147 provFile := pluginTgz + ".prov"
148 createProvFile(t, provFile, pluginTgz, "")
149 defer os.Remove(provFile)
150
151 // Create empty keyring file
152 keyring := createTestKeyring(t)
153 defer os.Remove(keyring)
154
155 out := &bytes.Buffer{}
156 cmd := newPluginVerifyCmd(out)
157 cmd.SetArgs([]string{"--keyring", keyring, pluginTgz})
158
159 // Should fail with keyring error but command parsing should work
160 err := cmd.Execute()
161 if err == nil {
162 t.Error("expected error with empty keyring")
163 }
164 // The important thing is that the keyring flag was parsed and used
165}
166
167func TestPluginVerifyOptions_Run_Success(t *testing.T) {
168 // Skip this test as it would require real PGP keys and valid signatures

Callers

nothing calls this directly

Calls 7

HelmHomeFunction · 0.92
createTestPluginTarballFunction · 0.85
newPluginVerifyCmdFunction · 0.85
createProvFileFunction · 0.70
createTestKeyringFunction · 0.70
RemoveMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…