fix tests vs running

main
bel 2025-05-05 21:32:26 -06:00
parent 352eff2691
commit 0e3e6c54de
2 changed files with 4 additions and 3 deletions

View File

@ -29,9 +29,9 @@ func TestOne(t *testing.T) {
},
"feeds": func(t *testing.T) context.Context {
gets := []string{}
sURL := "http://localhost:10000/"
sURL := "http://localhost:10001/"
s := &http.Server{
Addr: ":10000",
Addr: ":10001",
Handler: http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
gets = append(gets, r.URL.String())
rb, _ := io.ReadAll(r.Body)
@ -43,6 +43,7 @@ func TestOne(t *testing.T) {
case "10":
case "11":
default:
t.Logf("%s => 404", r.URL)
http.NotFound(w, r)
}

View File

@ -132,7 +132,7 @@ func proxyFetch(ctx context.Context, u string) (string, error) {
b, _ := io.ReadAll(resp.Body)
if resp.StatusCode != http.StatusOK {
return "", fmt.Errorf("failed fetch: (%d) %s", resp.StatusCode, b)
return "", fmt.Errorf("failed fetch %s %s: (%d) %s", req.Method, req.URL.String(), resp.StatusCode, b)
}
return string(b), nil