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

Function TestRepositoriesService_ListTeams

github/repos_test.go:816–851  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

814}
815
816func TestRepositoriesService_ListTeams(t *testing.T) {
817 t.Parallel()
818 client, mux, _ := setup(t)
819
820 mux.HandleFunc("/repos/o/r/teams", func(w http.ResponseWriter, r *http.Request) {
821 testMethod(t, r, "GET")
822 testFormValues(t, r, values{"page": "2"})
823 fmt.Fprint(w, `[{"id":1}]`)
824 })
825
826 opt := &ListOptions{Page: 2}
827 ctx := t.Context()
828 teams, _, err := client.Repositories.ListTeams(ctx, "o", "r", opt)
829 if err != nil {
830 t.Errorf("Repositories.ListTeams returned error: %v", err)
831 }
832
833 want := []*Team{{ID: Ptr(int64(1))}}
834 if !cmp.Equal(teams, want) {
835 t.Errorf("Repositories.ListTeams returned %+v, want %+v", teams, want)
836 }
837
838 const methodName = "ListTeams"
839 testBadOptions(t, methodName, func() (err error) {
840 _, _, err = client.Repositories.ListTeams(ctx, "\n", "\n", opt)
841 return err
842 })
843
844 testNewRequestAndDoFailure(t, methodName, client, func() (*Response, error) {
845 got, resp, err := client.Repositories.ListTeams(ctx, "o", "r", opt)
846 if got != nil {
847 t.Errorf("testNewRequestAndDoFailure %v = %#v, want nil", methodName, got)
848 }
849 return resp, err
850 })
851}
852
853func TestRepositoriesService_ListTags(t *testing.T) {
854 t.Parallel()

Callers

nothing calls this directly

Calls 8

testMethodFunction · 0.85
testFormValuesFunction · 0.85
testBadOptionsFunction · 0.85
EqualMethod · 0.80
setupFunction · 0.70
PtrFunction · 0.70
ListTeamsMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…