MCPcopy Create free account
hub / github.com/google/go-github / Test_ListOAuthApps

Function Test_ListOAuthApps

scrape/apps_test.go:56–91  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

54}
55
56func Test_ListOAuthApps(t *testing.T) {
57 t.Parallel()
58 client, mux := setup(t)
59
60 mux.HandleFunc("/organizations/e/settings/oauth_application_policy", func(w http.ResponseWriter, _ *http.Request) {
61 copyTestFile(t, w, "access-restrictions-enabled.html")
62 })
63
64 got, err := client.ListOAuthApps("e")
65 if err != nil {
66 t.Fatalf("ListOAuthApps(e) returned err: %v", err)
67 }
68 want := []*OAuthApp{
69 {
70 ID: 22222,
71 Name: "Coveralls",
72 Description: "Test coverage history and statistics.",
73 State: OAuthAppRequested,
74 RequestedBy: "willnorris",
75 },
76 {
77 ID: 530107,
78 Name: "Google Cloud Platform",
79 State: OAuthAppApproved,
80 },
81 {
82 ID: 231424,
83 Name: "GitKraken",
84 Description: "An intuitive, cross-platform Git client that doesn't suck, built by @axosoft and made with @nodegit & @ElectronJS.",
85 State: OAuthAppDenied,
86 },
87 }
88 if !cmp.Equal(got, want) {
89 t.Errorf("ListOAuthApps(o) returned %v, want %v", got, want)
90 }
91}
92
93func Test_CreateApp(t *testing.T) {
94 t.Parallel()

Callers

nothing calls this directly

Calls 4

copyTestFileFunction · 0.85
ListOAuthAppsMethod · 0.80
EqualMethod · 0.80
setupFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…