fixup path filling

Signed-off-by: Vasiliy Tolstov <v.tolstov@unistack.org>
This commit is contained in:
2024-05-04 13:41:59 +03:00
parent 9d955fc079
commit b92b2541e0
4 changed files with 24 additions and 14 deletions

View File

@@ -25,8 +25,8 @@ func TestNestedPath(t *testing.T) {
if err != nil {
t.Fatal(err)
}
if u.String() != "/api/v1/first/second?field1=fieldval" {
t.Fatal("nested path error")
if s := u.String(); s != "/api/v1/first/second?field1=fieldval" {
t.Fatalf("nested path error %s", s)
}
}
@@ -90,8 +90,8 @@ func TestValidPath(t *testing.T) {
func TestInvalidPath(t *testing.T) {
req := &request{Name: "vtolstov", Field1: "field1", Field2: "field2", Field3: 10}
_, _, err := newPathRequest("/api/v1/{xname}/list", "GET", "", req, nil, nil)
s, _, err := newPathRequest("/api/v1/{xname}/list", "GET", "", req, nil, nil)
if err == nil {
t.Fatal("path param must not be filled")
t.Fatalf("path param must not be filled: %s", s)
}
}