-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Filebase requires setting "region" to "us-east-1" in the AWS Client configuration.
- Loading branch information
Showing
3 changed files
with
32 additions
and
12 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 |
---|---|---|
|
@@ -155,6 +155,28 @@ func TestStorjS3Read(t *testing.T) { | |
} | ||
} | ||
|
||
func TestFilebaseS3Read(t *testing.T) { | ||
s3key := os.Getenv("FILEBASE_S3_KEY") | ||
s3secret := os.Getenv("FILEBASE_S3_SECRET") | ||
s3bucket := os.Getenv("FILEBASE_S3_BUCKET") | ||
s3Path := os.Getenv("FILEBASE_S3_PATH") | ||
require := require.New(t) | ||
if s3key != "" && s3secret != "" && s3bucket != "" && s3Path != "" { | ||
fullUrl := fmt.Sprintf("s3+https://%s:%[email protected]/%s", s3key, s3secret, s3bucket) | ||
os, err := ParseOSURL(fullUrl, true) | ||
require.NoError(err) | ||
session := os.NewSession("") | ||
data, err := session.ReadData(context.Background(), s3Path) | ||
require.NoError(err) | ||
osBuf := new(bytes.Buffer) | ||
osBuf.ReadFrom(data.Body) | ||
osData := osBuf.Bytes() | ||
require.True(len(osData) > 0) | ||
} else { | ||
t.Skip("No S3 credentials, test skipped") | ||
} | ||
} | ||
|
||
func TestWasabiS3Upload(t *testing.T) { | ||
s3key := os.Getenv("WASABI_S3_KEY") | ||
s3secret := os.Getenv("WASABI_S3_SECRET") | ||
|