MCPcopy
hub / github.com/rclone/rclone / parseHTML

Function parseHTML

backend/http/http_internal_test.go:392–406  ·  view source on GitHub ↗

Load HTML from the file given and parse it, checking it against the entries passed in

(t *testing.T, name string, base string, want []string)

Source from the content-addressed store, hash-verified

390
391// Load HTML from the file given and parse it, checking it against the entries passed in
392func parseHTML(t *testing.T, name string, base string, want []string) {
393 in, err := os.Open(filepath.Join(testPath, "index_files", name))
394 require.NoError(t, err)
395 defer func() {
396 require.NoError(t, in.Close())
397 }()
398 if base == "" {
399 base = "http://example.com/"
400 }
401 u, err := url.Parse(base)
402 require.NoError(t, err)
403 entries, err := parse(u, in)
404 require.NoError(t, err)
405 assert.Equal(t, want, entries)
406}
407
408func TestParseEmpty(t *testing.T) {
409 parseHTML(t, "empty.html", "", []string(nil))

Callers 5

TestParseEmptyFunction · 0.85
TestParseApacheFunction · 0.85
TestParseMemstoreFunction · 0.85
TestParseNginxFunction · 0.85
TestParseCaddyFunction · 0.85

Calls 5

JoinMethod · 0.80
parseFunction · 0.70
OpenMethod · 0.65
CloseMethod · 0.65
EqualMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…