@@ -137,6 +137,20 @@ func TestGitService_GetCommit(t *testing.T) {
137
137
if ! reflect .DeepEqual (commit , want ) {
138
138
t .Errorf ("Git.GetCommit returned %+v, want %+v" , commit , want )
139
139
}
140
+
141
+ const methodName = "GetCommit"
142
+ testBadOptions (t , methodName , func () (err error ) {
143
+ _ , _ , err = client .Git .GetCommit (ctx , "\n " , "\n " , "\n " )
144
+ return err
145
+ })
146
+
147
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
148
+ got , resp , err := client .Git .GetCommit (ctx , "o" , "r" , "s" )
149
+ if got != nil {
150
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
151
+ }
152
+ return resp , err
153
+ })
140
154
}
141
155
142
156
func TestGitService_GetCommit_invalidOwner (t * testing.T ) {
@@ -185,6 +199,20 @@ func TestGitService_CreateCommit(t *testing.T) {
185
199
if ! reflect .DeepEqual (commit , want ) {
186
200
t .Errorf ("Git.CreateCommit returned %+v, want %+v" , commit , want )
187
201
}
202
+
203
+ const methodName = "CreateCommit"
204
+ testBadOptions (t , methodName , func () (err error ) {
205
+ _ , _ , err = client .Git .CreateCommit (ctx , "\n " , "\n " , input )
206
+ return err
207
+ })
208
+
209
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
210
+ got , resp , err := client .Git .CreateCommit (ctx , "o" , "r" , input )
211
+ if got != nil {
212
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
213
+ }
214
+ return resp , err
215
+ })
188
216
}
189
217
190
218
func TestGitService_CreateSignedCommit (t * testing.T ) {
@@ -230,7 +258,22 @@ func TestGitService_CreateSignedCommit(t *testing.T) {
230
258
if ! reflect .DeepEqual (commit , want ) {
231
259
t .Errorf ("Git.CreateCommit returned %+v, want %+v" , commit , want )
232
260
}
261
+
262
+ const methodName = "CreateCommit"
263
+ testBadOptions (t , methodName , func () (err error ) {
264
+ _ , _ , err = client .Git .CreateCommit (ctx , "\n " , "\n " , input )
265
+ return err
266
+ })
267
+
268
+ testNewRequestAndDoFailure (t , methodName , client , func () (* Response , error ) {
269
+ got , resp , err := client .Git .CreateCommit (ctx , "o" , "r" , input )
270
+ if got != nil {
271
+ t .Errorf ("testNewRequestAndDoFailure %v = %#v, want nil" , methodName , got )
272
+ }
273
+ return resp , err
274
+ })
233
275
}
276
+
234
277
func TestGitService_CreateSignedCommitWithInvalidParams (t * testing.T ) {
235
278
client , _ , _ , teardown := setup ()
236
279
defer teardown ()
0 commit comments