MCPcopy
hub / github.com/kopia/kopia / AssertGetMetadataNotFound

Function AssertGetMetadataNotFound

internal/blobtesting/asserts.go:130–137  ·  view source on GitHub ↗

AssertGetMetadataNotFound asserts that GetMetadata() 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

128
129// AssertGetMetadataNotFound asserts that GetMetadata() for specified blobID returns ErrNotFound.
130func AssertGetMetadataNotFound(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID) {
131 t.Helper()
132
133 _, err := s.GetMetadata(ctx, blobID)
134 if !errors.Is(err, blob.ErrBlobNotFound) {
135 t.Fatalf("GetMetadata(%v) returned %v but expected ErrNotFound", blobID, err)
136 }
137}
138
139// AssertListResults asserts that the list results with given prefix return the specified list of names in order.
140func AssertListResults(ctx context.Context, t *testing.T, s blob.Storage, prefix blob.ID, want ...blob.ID) {

Callers 1

VerifyStorageFunction · 0.85

Calls 3

HelperMethod · 0.80
FatalfMethod · 0.80
GetMetadataMethod · 0.65

Tested by

no test coverage detected