porting - part 12 done

This commit is contained in:
2025-09-07 18:03:09 -07:00
parent 4d8075eaad
commit dccb072f73
4 changed files with 203 additions and 0 deletions

14
garth/testutils/http.go Normal file
View File

@@ -0,0 +1,14 @@
package testutils
import (
"net/http"
"net/http/httptest"
)
func MockJSONResponse(code int, body string) *httptest.Server {
return httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
w.WriteHeader(code)
w.Write([]byte(body))
}))
}