MCPcopy Create free account
hub / github.com/kopia/kopia / AssertGetBlobNotFound

Function AssertGetBlobNotFound

internal/blobtesting/asserts.go:104–114  ·  view source on GitHub ↗

AssertGetBlobNotFound asserts that GetBlob() for specified blobID returns ErrNotFound.

(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID)

Source from the content-addressed store, hash-verified

102
103// AssertGetBlobNotFound asserts that GetBlob() for specified blobID returns ErrNotFound.
104func AssertGetBlobNotFound(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID) {
105 t.Helper()
106
107 var b gather.WriteBuffer
108 defer b.Close()
109
110 err := s.GetBlob(ctx, blobID, 0, -1, &b)
111 if !errors.Is(err, blob.ErrBlobNotFound) || b.Length() != 0 {
112 t.Fatalf("GetBlob(%v) returned %v, %v but expected ErrNotFound", blobID, b.Length(), err)
113 }
114}
115
116// AssertInvalidCredentials asserts that GetBlob() for specified blobID returns ErrInvalidCredentials.
117func AssertInvalidCredentials(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID) {

Callers 3

TestOwnWritesFunction · 0.92
VerifyStorageFunction · 0.85

Calls 5

CloseMethod · 0.95
LengthMethod · 0.95
HelperMethod · 0.80
FatalfMethod · 0.80
GetBlobMethod · 0.65

Tested by 2

TestOwnWritesFunction · 0.74

Used in the wild real call sites across dependent graphs

searching dependent graphs…