MCPcopy Index your code
hub / github.com/google/go-github / TestGitignoresService_List

Function TestGitignoresService_List

github/gitignore_test.go:16–44  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

14)
15
16func TestGitignoresService_List(t *testing.T) {
17 t.Parallel()
18 client, mux, _ := setup(t)
19
20 mux.HandleFunc("/gitignore/templates", func(w http.ResponseWriter, r *http.Request) {
21 testMethod(t, r, "GET")
22 fmt.Fprint(w, `["C", "Go"]`)
23 })
24
25 ctx := t.Context()
26 available, _, err := client.Gitignores.List(ctx)
27 if err != nil {
28 t.Errorf("Gitignores.List returned error: %v", err)
29 }
30
31 want := []string{"C", "Go"}
32 if !cmp.Equal(available, want) {
33 t.Errorf("Gitignores.List returned %+v, want %+v", available, want)
34 }
35
36 const methodName = "List"
37 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
38 got, resp, err := client.Gitignores.List(ctx)
39 if got != nil {
40 t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
41 }
42 return resp, err
43 })
44}
45
46func TestGitignoresService_Get(t *testing.T) {
47 t.Parallel()

Callers

nothing calls this directly

Calls 5

testMethodFunction · 0.85
EqualMethod · 0.80
setupFunction · 0.70
ListMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…