MCPcopy Create free account
hub / github.com/docker/secrets-engine / assertStoredValue

Function assertStoredValue

plugins/pass/commands/command_test.go:258–267  ·  view source on GitHub ↗

assertStoredValue asserts the secret stored under id "foo" — every set-test uses that id, so the helpers hard-code it rather than carrying a parameter that always receives the same string.

(t *testing.T, kc store.Store, want string)

Source from the content-addressed store, hash-verified

256// uses that id, so the helpers hard-code it rather than carrying a parameter
257// that always receives the same string.
258func assertStoredValue(t *testing.T, kc store.Store, want string) {
259 t.Helper()
260 s, err := kc.Get(t.Context(), secrets.MustParseID("foo"))
261 require.NoError(t, err)
262 impl, ok := s.(*pass.PassValue)
263 require.True(t, ok)
264 got, err := impl.Marshal()
265 require.NoError(t, err)
266 assert.Equal(t, want, string(got))
267}
268
269func assertStoredMetadata(t *testing.T, kc store.Store, want map[string]string) {
270 t.Helper()

Callers 1

Test_SetCommandFunction · 0.85

Calls 2

GetMethod · 0.65
MarshalMethod · 0.65

Tested by

no test coverage detected