MCPcopy
hub / github.com/perkeep/perkeep / mustReceive

Function mustReceive

pkg/blobserver/cond/cond_test.go:41–54  ·  view source on GitHub ↗
(t *testing.T, dst blobserver.Storage, tb *test.Blob)

Source from the content-addressed store, hash-verified

39}
40
41func mustReceive(t *testing.T, dst blobserver.Storage, tb *test.Blob) blob.SizedRef {
42 tbRef := tb.BlobRef()
43 sb, err := blobserver.Receive(ctxbg, dst, tbRef, tb.Reader())
44 if err != nil {
45 t.Fatalf("Receive: %v", err)
46 }
47 if int(sb.Size) != len(tb.Contents) {
48 t.Fatalf("size = %d; want %d", sb.Size, len(tb.Contents))
49 }
50 if sb.Ref != tbRef {
51 t.Fatal("wrong blob received")
52 }
53 return sb
54}
55
56func TestStorageTest(t *testing.T) {
57 storagetest.Test(t, func(t *testing.T) blobserver.Storage {

Callers 1

TestReceiveIsSchemaFunction · 0.70

Calls 5

ReceiveFunction · 0.92
ReaderMethod · 0.80
FatalMethod · 0.80
BlobRefMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected