Skip to content

Commit a649dc2

Browse files
Update httpcall_test.go
1 parent 5e5a806 commit a649dc2

File tree

1 file changed

+23
-23
lines changed

1 file changed

+23
-23
lines changed

httpcall/httpcall_test.go

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
11
package httpcall_test
22

3-
import (
4-
"context"
5-
"testing"
6-
"time"
3+
// import (
4+
// "context"
5+
// "testing"
6+
// "time"
77

8-
"github.com/memory-overflow/go-common-library/httpcall"
9-
service "github.com/memory-overflow/go-common-library/task_scheduler/example/add_service"
10-
)
8+
// "github.com/memory-overflow/go-common-library/httpcall"
9+
// service "github.com/memory-overflow/go-common-library/task_scheduler/example/add_service"
10+
// )
1111

12-
func TestJsonPost(t *testing.T) {
13-
// 控制请求超时时间
14-
ctx, cancel := context.WithTimeout(context.Background(), time.Second)
15-
defer cancel()
16-
uri := "http://127.0.0.1:8000/add"
17-
req := &service.AddRequest{
18-
A: 1,
19-
B: 2,
20-
}
21-
rsp := &service.AddResponse{}
22-
err := httpcall.JsonPost(ctx, uri, nil, req, rsp)
23-
if err != nil {
24-
t.Fatalf("JsonPost err: %v", err)
25-
}
26-
t.Logf("add taskId: %d", rsp.TaskId)
27-
}
12+
// func TestJsonPost(t *testing.T) {
13+
// // 控制请求超时时间
14+
// ctx, cancel := context.WithTimeout(context.Background(), time.Second)
15+
// defer cancel()
16+
// uri := "http://127.0.0.1:8000/add"
17+
// req := &service.AddRequest{
18+
// A: 1,
19+
// B: 2,
20+
// }
21+
// rsp := &service.AddResponse{}
22+
// err := httpcall.JsonPost(ctx, uri, nil, req, rsp)
23+
// if err != nil {
24+
// t.Fatalf("JsonPost err: %v", err)
25+
// }
26+
// t.Logf("add taskId: %d", rsp.TaskId)
27+
// }

0 commit comments

Comments
 (0)