Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephen Bishtawi committed Jan 30, 2020
1 parent 459f15b commit 0f10e74
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions source/aws_s3/s3_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"testing"

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/s3"
"github.com/golang-migrate/migrate/v4/source"
st "github.com/golang-migrate/migrate/v4/source/testing"
Expand Down Expand Up @@ -43,6 +44,20 @@ func Test(t *testing.T) {
st.Test(t, &driver)
}

func TestSetAWSSession(t *testing.T) {
customSession, err := session.NewSession(&aws.Config{
Endpoint: aws.String("http://localhost:4572"),
S3ForcePathStyle: aws.Bool(true),
})
if err != nil {
t.Fatal(err)
}
SetAWSSession(customSession)
if customSession != awsSession {
t.Error("Custom AWS session was not saved")
}
}

type fakeS3 struct {
s3.S3
bucket string
Expand Down

0 comments on commit 0f10e74

Please sign in to comment.