MCPcopy Create free account
hub / github.com/DoNewsCode/core / TestPreferDriverInDI_error

Function TestPreferDriverInDI_error

leader/dependency_test.go:135–144  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

133}
134
135func TestPreferDriverInDI_error(t *testing.T) {
136 g := dig.New()
137 g.Provide(func() (Driver, error) {
138 return mockDriver{}, errors.New("err")
139 })
140 _, err := newDefaultDriver(DriverArgs{
141 Populator: di.IntoPopulator(g),
142 })
143 assert.Error(t, err)
144}

Callers

nothing calls this directly

Calls 4

IntoPopulatorFunction · 0.92
newDefaultDriverFunction · 0.85
ProvideMethod · 0.80
ErrorMethod · 0.45

Tested by

no test coverage detected