MCPcopy
hub / github.com/minio/minio-go / TestChainProviderWithNoValidProvider

Function TestChainProviderWithNoValidProvider

pkg/credentials/chain_test.go:128–150  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

126}
127
128func TestChainProviderWithNoValidProvider(t *testing.T) {
129 errs := []error{
130 errors.New("FirstError"),
131 errors.New("SecondError"),
132 }
133 p := &Chain{
134 Providers: []Provider{
135 &credProvider{err: errs[0]},
136 &credProvider{err: errs[1]},
137 },
138 }
139
140 if !p.IsExpired() {
141 t.Fatal("Expected to be expired with no providers")
142 }
143
144 _, err := p.RetrieveWithCredContext(defaultCredContext)
145 if err != nil {
146 if err.Error() != "No valid providers found [FirstError SecondError]" {
147 t.Error(err)
148 }
149 }
150}

Callers

nothing calls this directly

Calls 3

IsExpiredMethod · 0.95
ErrorMethod · 0.45

Tested by

no test coverage detected