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

Function TestChainRetriever_AllFail

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

Source from the content-addressed store, hash-verified

38}
39
40func TestChainRetriever_AllFail(t *testing.T) {
41 chain := NewChain(
42 &mockRetriever{err: errors.New("first failed")},
43 &mockRetriever{err: errors.New("second failed")},
44 )
45 key, err := chain.RetrieveKey(Hints{KeychainLabel: "Chrome"})
46 require.Error(t, err)
47 assert.Nil(t, key)
48 assert.Contains(t, err.Error(), "all retrievers failed")
49 assert.Contains(t, err.Error(), "first failed")
50 assert.Contains(t, err.Error(), "second failed")
51}
52
53func TestChainRetriever_SkipEmptyKey(t *testing.T) {
54 // First returns nil key without error — should skip to next

Callers

nothing calls this directly

Calls 3

NewChainFunction · 0.85
ErrorMethod · 0.80
RetrieveKeyMethod · 0.65

Tested by

no test coverage detected