MCPcopy
hub / github.com/moonD4rk/HackBrowserData / TestChainRetriever_FallbackOnError

Function TestChainRetriever_FallbackOnError

masterkey/retriever_test.go:30–38  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

28}
29
30func TestChainRetriever_FallbackOnError(t *testing.T) {
31 chain := NewChain(
32 &mockRetriever{err: errors.New("first failed")},
33 &mockRetriever{key: []byte("fallback-key")},
34 )
35 key, err := chain.RetrieveKey(Hints{KeychainLabel: "Chrome"})
36 require.NoError(t, err)
37 assert.Equal(t, []byte("fallback-key"), key)
38}
39
40func TestChainRetriever_AllFail(t *testing.T) {
41 chain := NewChain(

Callers

nothing calls this directly

Calls 2

NewChainFunction · 0.85
RetrieveKeyMethod · 0.65

Tested by

no test coverage detected