AssertGetBlobNotFound asserts that GetBlob() for specified blobID returns ErrNotFound.
(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID)
| 102 | |
| 103 | // AssertGetBlobNotFound asserts that GetBlob() for specified blobID returns ErrNotFound. |
| 104 | func 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. |
| 117 | func AssertInvalidCredentials(ctx context.Context, t *testing.T, s blob.Storage, blobID blob.ID) { |
searching dependent graphs…