Skip to content

Commit

Permalink
test: optimize adaptor unit_tests (#7)
Browse files Browse the repository at this point in the history
* test: optimize adaptor unit_tests

* style: gofumpt

* feat: add more adaptor test

* style: gofumpt

* del: delete useless codes

* style: gofumpt

* fix: remove extra request copy

---------

Co-authored-by: kinggo <[email protected]>
  • Loading branch information
ViolaPioggia and li-jin-gou committed Feb 17, 2024
1 parent 0f6df5d commit e49e29a
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions adaptor/handler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ package adaptor

import (
"context"
"fmt"
"io/ioutil"
"net/http"
"net/url"
Expand Down Expand Up @@ -477,10 +478,16 @@ func TestFile(t *testing.T) {
assert.NotEqual(t, req.Header.Get("Content-Type"), "application/x-www-form-urlencoded")

err := req.ParseForm()
assert.Nil(t, err)
if err != nil {
fmt.Println(err)
panic(err)
}

file, m, err := req.FormFile("file")
assert.Nil(t, err)
if err != nil {
fmt.Println(err)
panic(err)
}

assert.DeepEqual(t, m.Filename, "handler.go")

Expand Down

0 comments on commit e49e29a

Please sign in to comment.