-
Notifications
You must be signed in to change notification settings - Fork 177
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow to pass region in the custom s3 storage url like this:
s3+http://user:[email protected]:9000/path/to/region-name/bucket-name
- Loading branch information
1 parent
60b297e
commit 5153377
Showing
4 changed files
with
28 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,14 +26,28 @@ func TestS3URL(t *testing.T) { | |
|
||
func TestCustomS3URL(t *testing.T) { | ||
assert := assert.New(t) | ||
os, err := ParseOSURL("s3+http://user:[email protected]:9000/path/to/bucket-name", true) | ||
os, err := ParseOSURL("s3+http://user:[email protected]:9000/bucket-name", true) | ||
s3, iss3 := os.(*s3OS) | ||
assert.Equal(true, iss3) | ||
assert.Equal(nil, err) | ||
assert.Equal("http://example.com:9000", s3.host) | ||
assert.Equal("bucket-name", s3.bucket) | ||
assert.Equal("user", s3.awsAccessKeyID) | ||
assert.Equal("password", s3.awsSecretAccessKey) | ||
assert.Equal("ignored", s3.region) | ||
} | ||
|
||
func TestCustomS3URLWithRegion(t *testing.T) { | ||
assert := assert.New(t) | ||
os, err := ParseOSURL("s3+http://user:[email protected]:9000/path/to/region-name/bucket-name", true) | ||
s3, iss3 := os.(*s3OS) | ||
assert.Equal(true, iss3) | ||
assert.Equal(nil, err) | ||
assert.Equal("http://example.com:9000", s3.host) | ||
assert.Equal("bucket-name", s3.bucket) | ||
assert.Equal("region-name", s3.region) | ||
assert.Equal("user", s3.awsAccessKeyID) | ||
assert.Equal("password", s3.awsSecretAccessKey) | ||
} | ||
|
||
func TestGSURL(t *testing.T) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters