format Unix
This commit is contained in:
@@ -1,28 +1,28 @@
|
||||
package utils
|
||||
|
||||
// https://pkg.go.dev/github.com/stretchr/testify/assert#Nilf
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/jarcoal/httpmock"
|
||||
)
|
||||
|
||||
func TestDownload(t *testing.T){
|
||||
httpmock.Activate()
|
||||
defer httpmock.DeactivateAndReset()
|
||||
|
||||
url := "http://test.download.com"
|
||||
|
||||
httpmock.RegisterResponder("GET", url,
|
||||
httpmock.NewStringResponder(200, `CONTENU_URL`))
|
||||
|
||||
dest := filepath.Join(TEST_DEST_DIR, "url")
|
||||
|
||||
err := DownloadFromUrl(dest, url, 777)
|
||||
assert.Nilf(t, err, "error message %s", url)
|
||||
assert.FileExists(t, dest, "DownloadFromUrl error")
|
||||
}
|
||||
package utils
|
||||
|
||||
// https://pkg.go.dev/github.com/stretchr/testify/assert#Nilf
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
"github.com/jarcoal/httpmock"
|
||||
)
|
||||
|
||||
func TestDownload(t *testing.T){
|
||||
httpmock.Activate()
|
||||
defer httpmock.DeactivateAndReset()
|
||||
|
||||
url := "http://test.download.com"
|
||||
|
||||
httpmock.RegisterResponder("GET", url,
|
||||
httpmock.NewStringResponder(200, `CONTENU_URL`))
|
||||
|
||||
dest := filepath.Join(TEST_DEST_DIR, "url")
|
||||
|
||||
err := DownloadFromUrl(dest, url, 777)
|
||||
assert.Nilf(t, err, "error message %s", url)
|
||||
assert.FileExists(t, dest, "DownloadFromUrl error")
|
||||
}
|
||||
|
Reference in New Issue
Block a user