(t *testing.T)
| 36 | } |
| 37 | |
| 38 | func TestNewHTTPFetcher(t *testing.T) { |
| 39 | // nolint:exhaustruct // WONTFIX - external struct. |
| 40 | client := &http.Client{} |
| 41 | |
| 42 | t.Run("valid URL", func(t *testing.T) { |
| 43 | fetcher, err := NewHTTPFetcher("http://example.com", client) |
| 44 | if err != nil { |
| 45 | t.Fatalf("unexpected error: %v", err) |
| 46 | } |
| 47 | if fetcher == nil { |
| 48 | t.Fatal("fetcher should not be nil") |
| 49 | } |
| 50 | }) |
| 51 | |
| 52 | t.Run("invalid URL", func(t *testing.T) { |
| 53 | _, err := NewHTTPFetcher(":", client) |
| 54 | if err == nil { |
| 55 | t.Fatal("expected an error for invalid URL, but got nil") |
| 56 | } |
| 57 | }) |
| 58 | } |
| 59 | |
| 60 | func TestHTTPFetcher_Fetch(t *testing.T) { |
| 61 | t.Run("successful fetch", func(t *testing.T) { |
nothing calls this directly
no test coverage detected