Skip to content

Commit

Permalink
Fix broken test
Browse files Browse the repository at this point in the history
  • Loading branch information
GermanCoding committed Nov 29, 2024
1 parent 0f38e28 commit a6a774d
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions golang/vaas/v3/pkg/vaas/vaas_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -388,8 +388,15 @@ func Test_ForStream_WitEicarFromUrl_ReturnsMalicious(t *testing.T) {
func Test_ForStream_SendsUserAgent(t *testing.T) {
eicarReader := strings.NewReader("X5O!P%@AP[4\\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*")
server := getHttpTestServer(func(w http.ResponseWriter, r *http.Request) {
assert.Equal(t, r.Header.Get("User-Agent"), "Go/3.0.10-alpha")
defaultHttpHandler(t, w, r)
if strings.Contains(r.URL.Path, "/report") {
assert.Equal(t, r.Header.Get("User-Agent"), "Go/3.0.10-alpha")
defaultHttpHandler(t, w, r)
} else {
assert.Equal(t, r.Header.Get("User-Agent"), "Go/3.0.10-alpha")
w.WriteHeader(http.StatusCreated)
_, err := w.Write([]byte(`{"sha256": "12345"}`))
assert.NoError(t, err)
}
})
defer server.Close()

Expand Down

0 comments on commit a6a774d

Please sign in to comment.