Qwant Title
Qwant description
package engines import ( "context" "net/http" "testing" "github.com/metamorphosis-dev/kafka/internal/contracts" ) func TestQwantEngine_WebLite(t *testing.T) { transport := roundTripperFunc(func(r *http.Request) (*http.Response, error) { if r.Method != http.MethodGet { return httpResponse(http.StatusMethodNotAllowed, "", ""), nil } if r.URL.Host != "lite.qwant.com" { return httpResponse(http.StatusNotFound, "", ""), nil } if r.URL.Path != "/" { // goquery request URL parsing should normalize to "/" t.Fatalf("unexpected path: %s", r.URL.Path) } q := r.URL.Query().Get("q") if q != "hugo" { t.Fatalf("unexpected q: %q", q) } if r.URL.Query().Get("locale") != "en_us" { t.Fatalf("unexpected locale: %q", r.URL.Query().Get("locale")) } if r.URL.Query().Get("l") != "en" { t.Fatalf("unexpected l: %q", r.URL.Query().Get("l")) } if r.URL.Query().Get("s") != "0" { t.Fatalf("unexpected s: %q", r.URL.Query().Get("s")) } if r.URL.Query().Get("p") != "1" { t.Fatalf("unexpected p: %q", r.URL.Query().Get("p")) } body := `
Qwant description
Ad description