Skip to content

Commit

Permalink
test will now pass
Browse files Browse the repository at this point in the history
  • Loading branch information
ItamarYuran committed Dec 26, 2024
1 parent 69764b1 commit 0b2e2b4
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions esti/s3_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,15 +206,15 @@ func TestMultipartUploadIfNoneMatch(t *testing.T) {
const timeResolution = time.Second
ctx, logger, repo := setupTest(t)
defer tearDownTest(repo)
s3Endpoint := viper.GetString("s3_endpoint")
s3Client := createS3Client(s3Endpoint, t)
type TestCase struct {
Path string
Content string
IfNoneMatch string
ExpectError bool
}
// s3Endpoint := viper.GetString("s3_endpoint")
// s3Client := createS3Client(s3Endpoint, t)
defer tearDownTest(repo)

testCases := []TestCase{
{Path: "main/object1", Content: "data", IfNoneMatch: "", ExpectError: false},
{Path: "main/object1", Content: "data", IfNoneMatch: "*", ExpectError: true},
Expand All @@ -225,7 +225,7 @@ func TestMultipartUploadIfNoneMatch(t *testing.T) {
Key: aws.String(tc.Path),
}

resp, err := svc.CreateMultipartUpload(ctx, input)
resp, err := s3Client.CreateMultipartUpload(ctx, input)
require.NoError(t, err, "failed to create multipart upload")
logger.Info("Created multipart upload request")

Expand All @@ -246,7 +246,7 @@ func TestMultipartUploadIfNoneMatch(t *testing.T) {
Parts: completedParts,
},
}
completeResponse, err := svc.CompleteMultipartUpload(ctx, completeInput, s3.WithAPIOptions(setHTTPHeaders(tc.IfNoneMatch)))
completeResponse, err := s3Client.CompleteMultipartUpload(ctx, completeInput, s3.WithAPIOptions(setHTTPHeaders(tc.IfNoneMatch)))
if tc.ExpectError {
require.Error(t, err, "was expecting an error with path %s and header %s in test case # %s", tc.Path, tc.IfNoneMatch)
} else {
Expand Down

0 comments on commit 0b2e2b4

Please sign in to comment.