mirror of
https://github.com/Forceu/Gokapi.git
synced 2026-04-26 00:19:55 -05:00
Fixed tests
This commit is contained in:
@@ -108,7 +108,7 @@ func Upload(input io.Reader, file models.File) (string, error) {
|
||||
}
|
||||
|
||||
// Download downloads a file from AWS
|
||||
func Download(writer io.WriterAt, file models.File) (int64, error) {
|
||||
func download(writer io.WriterAt, file models.File) (int64, error) {
|
||||
if !isValidCredentials() {
|
||||
return 0, errors.New("invalid credentials / invalid bucket / invalid region")
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ func Upload(input io.Reader, file models.File) (string, error) {
|
||||
}
|
||||
|
||||
// Download downloads a file from AWS
|
||||
func Download(writer io.WriterAt, file models.File) (int64, error) {
|
||||
func download(writer io.WriterAt, file models.File) (int64, error) {
|
||||
return 0, errors.New(errorString)
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ func TestUploadToAws(t *testing.T) {
|
||||
func TestDownloadFromAws(t *testing.T) {
|
||||
test.FileDoesNotExist(t, "test")
|
||||
file, _ := os.Create("test")
|
||||
size, err := Download(file, testFile)
|
||||
size, err := download(file, testFile)
|
||||
test.IsNil(t, err)
|
||||
test.IsEqualBool(t, size == 16, true)
|
||||
test.FileExists(t, "test")
|
||||
|
||||
Reference in New Issue
Block a user