Skip to content

Commit

Permalink
Use error-check helper in TestGetNonExistingBucket (#4273)
Browse files Browse the repository at this point in the history
* Use error-check helper in TestGetNonExistingBucket

* Remove unused packages
  • Loading branch information
tdmanv authored and Ilya Kislenko committed Oct 25, 2018
1 parent 061da67 commit 2090564
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions pkg/objectstore/objectstore_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ import (
"testing"
"time"

"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/graymeta/stow"
"github.com/pkg/errors"
"golang.org/x/oauth2/google"
"google.golang.org/api/compute/v1"
. "gopkg.in/check.v1"
Expand Down Expand Up @@ -133,13 +131,7 @@ func (s *ObjectStoreProviderSuite) TestGetNonExistingBucket(c *C) {
bucketName := s.createBucketName(c)
bucket, err := s.provider.GetBucket(ctx, bucketName)
c.Check(err, NotNil)
switch errors.Cause(err).(type) {
case awserr.Error:
c.Logf("Got a aws err %s", errors.Cause(err).Error())
default:
c.Logf("Expecting an aws error. Got %s", err.Error())
c.Fail()
}
c.Assert(isBucketNotFoundError(err), Equals, true)
c.Check(bucket, IsNil)
}

Expand Down

0 comments on commit 2090564

Please sign in to comment.