(t *testing.T)
| 618 | } |
| 619 | |
| 620 | func TestGetCrawlerUser_InvalidJSON(t *testing.T) { |
| 621 | mux := http.NewServeMux() |
| 622 | mux.HandleFunc("/1/crawler/user", func(w http.ResponseWriter, r *http.Request) { |
| 623 | _, err := w.Write([]byte(`{"data":`)) |
| 624 | require.NoError(t, err) |
| 625 | }) |
| 626 | |
| 627 | ts, client := newTestClient(mux) |
| 628 | defer ts.Close() |
| 629 | |
| 630 | _, err := client.GetCrawlerUser("test-token") |
| 631 | require.Error(t, err) |
| 632 | assert.Contains(t, err.Error(), "failed to parse crawler response") |
| 633 | } |
| 634 | |
| 635 | func TestGetCrawlerUser_HTTPErrorInvalidJSON(t *testing.T) { |
| 636 | mux := http.NewServeMux() |
nothing calls this directly
no test coverage detected