MCPcopy Index your code
hub / github.com/kopia/kopia / mustReadObject

Function mustReadObject

internal/server/server_test.go:336–349  ·  view source on GitHub ↗
(ctx context.Context, t *testing.T, r repo.Repository, oid object.ID, want []byte)

Source from the content-addressed store, hash-verified

334}
335
336func mustReadObject(ctx context.Context, t *testing.T, r repo.Repository, oid object.ID, want []byte) {
337 t.Helper()
338
339 or, err := r.OpenObject(ctx, oid)
340 require.NoError(t, err)
341
342 data, err := io.ReadAll(or)
343 require.NoError(t, err)
344
345 // verify data is read back the same.
346 if diff := cmp.Diff(data, want); diff != "" {
347 t.Fatalf("invalid object data, diff: %v", diff)
348 }
349}
350
351func mustReadManifest(ctx context.Context, t *testing.T, r repo.Repository, manID manifest.ID, want string) {
352 t.Helper()

Callers 1

remoteRepositoryTestFunction · 0.85

Calls 3

HelperMethod · 0.80
FatalfMethod · 0.80
OpenObjectMethod · 0.65

Tested by

no test coverage detected