-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
acceptance test for downloading versioned files
- Loading branch information
Showing
3 changed files
with
88 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,70 @@ | ||
package sos_test | ||
|
||
func (s *SOSSuite) TestDownloadFiles() { | ||
test := SOSTest{ | ||
s.Execute(SOSTest{ | ||
Steps: []Step{ | ||
{ | ||
PreparedFiles: LocalFiles{ | ||
"file1.txt": "expected content", | ||
}, | ||
Commands: []string{ | ||
"storage upload {prepDir}file1.txt {bucket}", | ||
"storage download -r {bucket} {downloadDir}", | ||
"exo storage upload {prepDir}file1.txt {bucket}", | ||
"exo storage download -r {bucket} {downloadDir}", | ||
}, | ||
ExpectedDownloadFiles: LocalFiles{ | ||
"file1.txt": "expected content", | ||
}, | ||
}, | ||
}, | ||
} | ||
}) | ||
} | ||
|
||
s.Execute(test) | ||
func (s *SOSSuite) TestDownloadOverwrittenVersionedFile() { | ||
s.Execute(SOSTest{ | ||
Steps: []Step{ | ||
{ | ||
PreparedFiles: LocalFiles{ | ||
"file1.txt": "original content", | ||
}, | ||
Commands: []string{ | ||
"exo storage bucket versioning enable {bucket}", | ||
"exo storage upload {prepDir}file1.txt {bucket}", | ||
}, | ||
ExpectedDownloadFiles: LocalFiles{}, | ||
}, | ||
{ | ||
Description: "check if latest object is downloaded", | ||
PreparedFiles: LocalFiles{ | ||
"file1.txt": "new expected content", | ||
}, | ||
Commands: []string{ | ||
"exo storage upload {prepDir}file1.txt {bucket}", | ||
"exo storage download -f -r {bucket} {downloadDir}", | ||
}, | ||
ExpectedDownloadFiles: LocalFiles{ | ||
"file1.txt": "new expected content", | ||
}, | ||
}, | ||
{ | ||
Description: "check if v0 can be downloaded", | ||
PreparedFiles: LocalFiles{}, | ||
Commands: []string{ | ||
"exo storage download -f --only-versions v0 {bucket}/file1.txt {downloadDir}", | ||
}, | ||
ExpectedDownloadFiles: LocalFiles{ | ||
"file1.txt": "original content", | ||
}, | ||
}, | ||
{ | ||
Description: "check if v1 can be explicitly downloaded", | ||
PreparedFiles: LocalFiles{}, | ||
Commands: []string{ | ||
"exo storage download -f --only-versions v1 {bucket}/file1.txt {downloadDir}", | ||
}, | ||
ExpectedDownloadFiles: LocalFiles{ | ||
"file1.txt": "new expected content", | ||
}, | ||
}, | ||
}, | ||
}) | ||
} |
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