MCPcopy
hub / github.com/gofiber/fiber / Test_manager_set_StorageError

Function Test_manager_set_StorageError

middleware/cache/coverage_test.go:426–440  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

424}
425
426func Test_manager_set_StorageError(t *testing.T) {
427 t.Parallel()
428
429 storage := newFailingCacheStorage()
430 storage.errs["set|k"] = errors.New("boom")
431 m := newManager(storage, false)
432
433 it := m.acquire()
434 it.status = 200
435 err := m.set(context.Background(), "k", it, time.Minute)
436 require.ErrorContains(t, err, "boom")
437
438 // setRaw storage error.
439 require.ErrorContains(t, m.setRaw(context.Background(), "k", []byte("v"), time.Minute), "boom")
440}
441
442func Test_manager_get_StorageRoundTrip(t *testing.T) {
443 t.Parallel()

Callers

nothing calls this directly

Calls 6

newFailingCacheStorageFunction · 0.85
newManagerFunction · 0.70
NewMethod · 0.65
acquireMethod · 0.45
setMethod · 0.45
setRawMethod · 0.45

Tested by

no test coverage detected