(t *testing.T)
| 54 | } |
| 55 | |
| 56 | func 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 | |
| 93 | func Test_CreateApp(t *testing.T) { |
| 94 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…