Skip to content

Commit

Permalink
malformed url case coverage.
Browse files Browse the repository at this point in the history
Signed-off-by: Ariadna Rouco <[email protected]>
  • Loading branch information
ariadnarouco committed Oct 23, 2024
1 parent 2b3cc0b commit cfa0cf8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions utils/plugin/downloader_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,13 @@ func TestCheckShaOfPlugin(t *testing.T) {

func TestDownloadFile(t *testing.T) {
t.Run("test sha of real file", func(t *testing.T) {
err := downloadFile("error", "", FileDownloaderImpl{}, nil)
err := downloadFile("error", " ", FileDownloaderImpl{}, nil)
assert.Error(t, err)
assert.Contains(t, err.Error(), "failed to download file from")
})

t.Run("test download fail with invalid url", func(t *testing.T) {
url := "http://\x07World"
url := "://example.com"
err := downloadFile("error", url, FileDownloaderImpl{}, nil)
assert.Error(t, err)
assert.Contains(t, err.Error(), "failed to download file from")
Expand Down

0 comments on commit cfa0cf8

Please sign in to comment.