MCPcopy Create free account
hub / github.com/antchfx/htmlquery / TestLoadURLWithGzipResponse

Function TestLoadURLWithGzipResponse

query_test.go:84–97  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

82}
83
84func TestLoadURLWithGzipResponse(t *testing.T) {
85 ts := httptest.NewServer(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
86 w.Header().Add("Content-Encoding", "gzip")
87 gz := gzip.NewWriter(w)
88 defer gz.Close()
89 fmt.Fprint(gz, htmlSample)
90 }))
91 defer ts.Close()
92
93 _, err := LoadURL(ts.URL)
94 if err != nil {
95 t.Fatal(err)
96 }
97}
98
99func TestLoadDoc(t *testing.T) {
100 tempHTMLdoc, err := ioutil.TempFile("", "sample_*.html")

Callers

nothing calls this directly

Calls 1

LoadURLFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…