Skip to content

Commit

Permalink
update test
Browse files Browse the repository at this point in the history
  • Loading branch information
luopengift committed May 4, 2024
1 parent ba4f700 commit 7c59ebe
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion requests_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

func Test_Basic(t *testing.T) {
resp, err := Get("http://127.0.0.1:12345/get")
resp, err := Get("http://httpbin.org/get")
t.Logf("%#v, %v", resp, err)
//resp, _ = Post("http://httpbin.org/post", "application/json", strings.NewReader(`{"a": "b"}`))
//t.Log(resp.Text())
Expand Down
4 changes: 1 addition & 3 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func Test_Use(t *testing.T) {
}),
)
ctx, cancel := context.WithCancel(context.Background())

defer cancel()
s := requests.NewServer(ctx, r, requests.URL(":9099"))
s.OnShutdown(func(s *http.Server) {
t.Logf("http: %s shutdown...", s.Addr)
Expand All @@ -64,8 +64,6 @@ func Test_Use(t *testing.T) {
sess := requests.New(requests.URL("http://127.0.0.1:9099"))
_, _ = sess.DoRequest(context.Background(), requests.Path("/echo"), requests.Body("12345"), requests.Logf(LogS), requests.Method("OPTIONS"))
_, _ = sess.DoRequest(context.Background(), requests.Path("/echo"), requests.Body("12345"), requests.Logf(LogS), requests.Method("GET"))
cancel()
time.Sleep(3 * time.Second)
//sess.DoRequest(context.Background(), Path("/ping"), Logf(LogS))
//sess.DoRequest(context.Background(), Path("/1234"), Logf(LogS))

Expand Down

0 comments on commit 7c59ebe

Please sign in to comment.