Skip to content

Commit

Permalink
add missing checks in UsesPrefixTest
Browse files Browse the repository at this point in the history
Signed-off-by: Maria Eduarda Duarte <dudammduarte@yahoo.com.br>
  • Loading branch information
dudaduarte committed May 11, 2022
1 parent 5b05e98 commit 4f7e624
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/objstore/prefixed_bucket_test.go
Expand Up @@ -42,6 +42,7 @@ func UsesPrefixTest(t *testing.T, bkt Bucket, prefix string) {

pBkt := NewPrefixedBucket(bkt, prefix)
rc1, err := pBkt.Get(context.Background(), "file1.jpg")
testutil.Ok(t, err)

testutil.Ok(t, err)
defer func() { testutil.Ok(t, rc1.Close()) }()
Expand All @@ -51,6 +52,7 @@ func UsesPrefixTest(t *testing.T, bkt Bucket, prefix string) {

pBkt.Upload(context.Background(), "file2.jpg", strings.NewReader("test-data2"))
rc2, err := bkt.Get(context.Background(), strings.Trim(prefix, "/")+"/file2.jpg")
testutil.Ok(t, err)

testutil.Ok(t, err)
defer func() { testutil.Ok(t, rc2.Close()) }()
Expand All @@ -60,6 +62,7 @@ func UsesPrefixTest(t *testing.T, bkt Bucket, prefix string) {

pBkt.Delete(context.Background(), "file2.jpg")
_, err = bkt.Get(context.Background(), strings.Trim(prefix, "/")+"/file2.jpg")
testutil.Ok(t, err)

testutil.NotOk(t, err)
testutil.Assert(t, pBkt.IsObjNotFoundErr(err), "expected not found error got %s", err)
Expand Down

0 comments on commit 4f7e624

Please sign in to comment.