update tests

This commit is contained in:
Nurzhan Ilyassov 2024-03-26 12:44:45 +05:00 committed by Vasiliy Tolstov
parent 4c2178305d
commit fd803b1fe0

View File

@ -61,9 +61,16 @@ func TestNewPathRequest(t *testing.T) {
func TestNewPathRequestWithEmptyBody(t *testing.T) {
val := struct{}{}
cases := []string{
"",
"*",
"{}",
"nil",
`{"type": "invalid"}`,
}
for _, body := range cases {
for _, m := range []string{"POST", "PUT", "PATCH", "GET", "DELETE"} {
body := `{"type": "invalid"}`
path, nmsg, err := newPathRequest("/v1/test", m, body, val, []string{"protobuf", "json"}, nil)
if err != nil {
t.Fatal(err)
@ -82,6 +89,7 @@ func TestNewPathRequestWithEmptyBody(t *testing.T) {
}
}
}
}
func TestNewPathVarRequest(t *testing.T) {
type Message struct {