Skip to content

Commit

Permalink
g
Browse files Browse the repository at this point in the history
  • Loading branch information
komuw committed Dec 31, 2024
1 parent c3a5311 commit 348e6d2
Showing 1 changed file with 18 additions and 16 deletions.
34 changes: 18 additions & 16 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -153,21 +153,23 @@ func TestClient(t *testing.T) {
clean(res, cli)
}

{
// success
w := &bytes.Buffer{}
maxMsgs := 15
l := log.New(context.Background(), w, maxMsgs)

cli := Safe(l)

b := strings.NewReader(`{"key":"value"}`)
res, err := cli.Post("https://example.com", "application/json", b) // nolint:bodyclose
attest.NotZero(t, res)
attest.Ok(t, err)
attest.Zero(t, w.String())
attest.Equal(t, res.StatusCode, http.StatusOK)
clean(res, cli)
}
// todo: `example.com` no longer allows http POST.
//
// {
// // success
// w := &bytes.Buffer{}
// maxMsgs := 15
// l := log.New(context.Background(), w, maxMsgs)

// cli := Safe(l)

// b := strings.NewReader(`{"key":"value"}`)
// res, err := cli.Post("https://example.com", "application/json", b) // nolint:bodyclose
// attest.NotZero(t, res)
// attest.Ok(t, err)
// attest.Zero(t, w.String())
// attest.Equal(t, res.StatusCode, http.StatusOK)
// clean(res, cli)
// }
})
}

0 comments on commit 348e6d2

Please sign in to comment.