@@ -14,6 +14,47 @@ import (
1414 "github.com/google/go-cmp/cmp"
1515)
1616
17+ func TestOrganizationService_GetSecurityManagerRole (t * testing.T ) {
18+ t .Parallel ()
19+ client , mux , _ := setup (t )
20+
21+ handleGetSecurityManagerRole (t , mux , "o" )
22+
23+ ctx := context .Background ()
24+ role , _ , err := client .Organizations .GetSecurityManagerRole (ctx , "o" )
25+ if err != nil {
26+ t .Errorf ("Organizations.GetSecurityManagerRole returned error: %v" , err )
27+ }
28+
29+ want := & CustomOrgRoles {ID : Ptr (int64 (138 )), Name : Ptr ("security_manager" )}
30+ if ! cmp .Equal (role , want ) {
31+ t .Errorf ("Organizations.GetSecurityManagerRole returned %+v, want %+v" , role , want )
32+ }
33+
34+ const methodName = "GetSecurityManagerRole"
35+ testBadOptions (t , methodName , func () (err error ) {
36+ _ , _ , err = client .Organizations .GetSecurityManagerRole (ctx , "\n " )
37+ return err
38+ })
39+
40+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
41+ got , resp , err := client .Organizations .GetSecurityManagerRole (ctx , "o" )
42+ if got != nil {
43+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
44+ }
45+ return resp , err
46+ })
47+ }
48+
49+ func TestOrganizationsService_GetSecurityManagerRole_invalidOrg (t * testing.T ) {
50+ t .Parallel ()
51+ client , _ , _ := setup (t )
52+
53+ ctx := context .Background ()
54+ _ , _ , err := client .Organizations .GetSecurityManagerRole (ctx , "%" )
55+ testURLParseError (t , err )
56+ }
57+
1758func TestOrganizationsService_ListSecurityManagerTeams (t * testing.T ) {
1859 t .Parallel ()
1960 client , mux , _ := setup (t )
0 commit comments