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

Function Test_manager_get_StorageRoundTrip

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

Source from the content-addressed store, hash-verified

440}
441
442func Test_manager_get_StorageRoundTrip(t *testing.T) {
443 t.Parallel()
444
445 storage := newFailingCacheStorage()
446 m := newManager(storage, false)
447
448 it := m.acquire()
449 it.status = 201
450 it.body = []byte("hello")
451 require.NoError(t, m.set(context.Background(), "k", it, time.Minute))
452
453 got, err := m.get(context.Background(), "k")
454 require.NoError(t, err)
455 require.Equal(t, 201, got.status)
456 require.Equal(t, []byte("hello"), got.body)
457}
458
459func Test_varyManifest_StoreLoad(t *testing.T) {
460 t.Parallel()

Callers

nothing calls this directly

Calls 5

newFailingCacheStorageFunction · 0.85
newManagerFunction · 0.70
acquireMethod · 0.45
setMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected