forked from mirror/client_golang
Fixed TestDoGetFallback test
Signed-off-by: Joe Elliott <number101010@gmail.com>
This commit is contained in:
parent
393adc9261
commit
bd858421cd
|
@ -1268,12 +1268,16 @@ func TestDoGetFallback(t *testing.T) {
|
||||||
// Start a local HTTP server.
|
// Start a local HTTP server.
|
||||||
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
server := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
|
||||||
req.ParseForm()
|
req.ParseForm()
|
||||||
r := &testResponse{
|
testResp, _ := json.Marshal(&testResponse{
|
||||||
Values: req.Form.Encode(),
|
Values: req.Form.Encode(),
|
||||||
Method: req.Method,
|
Method: req.Method,
|
||||||
|
})
|
||||||
|
|
||||||
|
apiResp := &apiResponse{
|
||||||
|
Data: testResp,
|
||||||
}
|
}
|
||||||
|
|
||||||
body, _ := json.Marshal(r)
|
body, _ := json.Marshal(apiResp)
|
||||||
|
|
||||||
if req.Method == http.MethodPost {
|
if req.Method == http.MethodPost {
|
||||||
if req.URL.Path == "/blockPost" {
|
if req.URL.Path == "/blockPost" {
|
||||||
|
|
Loading…
Reference in New Issue