@@ -36,6 +36,20 @@ func TestRepositoriesService_ListDeployments(t *testing.T) {
3636if ! reflect .DeepEqual (deployments , want ) {
3737t .Errorf ("Repositories.ListDeployments returned %+v, want %+v" , deployments , want )
3838}
39+
40+ const methodName = "ListDeployments"
41+ testBadOptions (t , methodName , func () (err error ) {
42+ _ , _ , err = client .Repositories .ListDeployments (ctx , "\n " , "\n " , opt )
43+ return err
44+ })
45+
46+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
47+ got , resp , err := client .Repositories .ListDeployments (ctx , "o" , "r" , opt )
48+ if got != nil {
49+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
50+ }
51+ return resp , err
52+ })
3953}
4054
4155func TestRepositoriesService_GetDeployment (t * testing.T ) {
@@ -58,6 +72,20 @@ func TestRepositoriesService_GetDeployment(t *testing.T) {
5872if ! reflect .DeepEqual (deployment , want ) {
5973t .Errorf ("Repositories.GetDeployment returned %+v, want %+v" , deployment , want )
6074}
75+
76+ const methodName = "GetDeployment"
77+ testBadOptions (t , methodName , func () (err error ) {
78+ _ , _ , err = client .Repositories .GetDeployment (ctx , "\n " , "\n " , 3 )
79+ return err
80+ })
81+
82+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
83+ got , resp , err := client .Repositories .GetDeployment (ctx , "o" , "r" , 3 )
84+ if got != nil {
85+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
86+ }
87+ return resp , err
88+ })
6189}
6290
6391func TestRepositoriesService_CreateDeployment (t * testing.T ) {
@@ -90,6 +118,20 @@ func TestRepositoriesService_CreateDeployment(t *testing.T) {
90118if ! reflect .DeepEqual (deployment , want ) {
91119t .Errorf ("Repositories.CreateDeployment returned %+v, want %+v" , deployment , want )
92120}
121+
122+ const methodName = "CreateDeployment"
123+ testBadOptions (t , methodName , func () (err error ) {
124+ _ , _ , err = client .Repositories .CreateDeployment (ctx , "\n " , "\n " , input )
125+ return err
126+ })
127+
128+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
129+ got , resp , err := client .Repositories .CreateDeployment (ctx , "o" , "r" , input )
130+ if got != nil {
131+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
132+ }
133+ return resp , err
134+ })
93135}
94136
95137func TestRepositoriesService_DeleteDeployment (t * testing.T ) {
@@ -117,6 +159,16 @@ func TestRepositoriesService_DeleteDeployment(t *testing.T) {
117159if resp .StatusCode != http .StatusNotFound {
118160t .Error ("Repositories.DeleteDeployment should return a 404 status" )
119161}
162+
163+ const methodName = "DeleteDeployment"
164+ testBadOptions (t , methodName , func () (err error ) {
165+ _ , err = client .Repositories .DeleteDeployment (ctx , "\n " , "\n " , 1 )
166+ return err
167+ })
168+
169+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
170+ return client .Repositories .DeleteDeployment (ctx , "o" , "r" , 1 )
171+ })
120172}
121173
122174func TestRepositoriesService_ListDeploymentStatuses (t * testing.T ) {
@@ -142,6 +194,20 @@ func TestRepositoriesService_ListDeploymentStatuses(t *testing.T) {
142194if ! reflect .DeepEqual (statutses , want ) {
143195t .Errorf ("Repositories.ListDeploymentStatuses returned %+v, want %+v" , statutses , want )
144196}
197+
198+ const methodName = "ListDeploymentStatuses"
199+ testBadOptions (t , methodName , func () (err error ) {
200+ _ , _ , err = client .Repositories .ListDeploymentStatuses (ctx , "\n " , "\n " , 1 , opt )
201+ return err
202+ })
203+
204+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
205+ got , resp , err := client .Repositories .ListDeploymentStatuses (ctx , "o" , "r" , 1 , opt )
206+ if got != nil {
207+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
208+ }
209+ return resp , err
210+ })
145211}
146212
147213func TestRepositoriesService_GetDeploymentStatus (t * testing.T ) {
@@ -165,6 +231,20 @@ func TestRepositoriesService_GetDeploymentStatus(t *testing.T) {
165231if ! reflect .DeepEqual (deploymentStatus , want ) {
166232t .Errorf ("Repositories.GetDeploymentStatus returned %+v, want %+v" , deploymentStatus , want )
167233}
234+
235+ const methodName = "GetDeploymentStatus"
236+ testBadOptions (t , methodName , func () (err error ) {
237+ _ , _ , err = client .Repositories .GetDeploymentStatus (ctx , "\n " , "\n " , 3 , 4 )
238+ return err
239+ })
240+
241+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
242+ got , resp , err := client .Repositories .GetDeploymentStatus (ctx , "o" , "r" , 3 , 4 )
243+ if got != nil {
244+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
245+ }
246+ return resp , err
247+ })
168248}
169249
170250func TestRepositoriesService_CreateDeploymentStatus (t * testing.T ) {
@@ -197,4 +277,18 @@ func TestRepositoriesService_CreateDeploymentStatus(t *testing.T) {
197277if ! reflect .DeepEqual (deploymentStatus , want ) {
198278t .Errorf ("Repositories.CreateDeploymentStatus returned %+v, want %+v" , deploymentStatus , want )
199279}
280+
281+ const methodName = "CreateDeploymentStatus"
282+ testBadOptions (t , methodName , func () (err error ) {
283+ _ , _ , err = client .Repositories .CreateDeploymentStatus (ctx , "\n " , "\n " , 1 , input )
284+ return err
285+ })
286+
287+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
288+ got , resp , err := client .Repositories .CreateDeploymentStatus (ctx , "o" , "r" , 1 , input )
289+ if got != nil {
290+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
291+ }
292+ return resp , err
293+ })
200294}
0 commit comments