@@ -118,3 +118,48 @@ def test_create_comment(self):
118
118
expect (self .repo .create_comment (body , sha )
119
119
).isinstance (github3 .repos .RepoComment )
120
120
self .mock_assertions ()
121
+
122
+ def test_create_commit (self ):
123
+ self .request .return_value = generate_response ('commit' , 201 )
124
+ data = {'message' : 'My commit message' ,
125
+ 'author' : {
126
+ 'name' : 'Ian Cordasco' ,
127
+ 'email' : 'foo@example.com' ,
128
+ 'date' : '2008-07-09T16:13:30+12:00' ,
129
+ },
130
+ 'committer' : {},
131
+ 'parents' : [
132
+ '7d1b31e74ee336d15cbd21741bc88a537ed063a0'
133
+ ],
134
+ 'tree' : '827efc6d56897b048c772eb4087f854f46256132' ,
135
+ }
136
+ self .conf = {'data' : data }
137
+ self .args = ('post' , self .api + 'git/commits' )
138
+
139
+ with expect .githuberror ():
140
+ self .repo .create_commit (** data )
141
+
142
+ self .login ()
143
+ expect (self .repo .create_commit (None , None , None )).is_None ()
144
+ expect (self .repo .create_commit (** data )).isinstance (github3 .git .Commit )
145
+ self .mock_assertions ()
146
+
147
+ def test_create_download (self ):
148
+ pass
149
+
150
+ def test_create_fork (self ):
151
+ self .request .return_value = generate_response ('repo' , 202 )
152
+ self .conf = {'data' : None }
153
+ self .args = ('post' , self .api + 'forks' )
154
+
155
+ with expect .githuberror ():
156
+ self .repo .create_fork ()
157
+
158
+ self .login ()
159
+ expect (self .repo .create_fork ()).isinstance (github3 .repos .Repository )
160
+ self .mock_assertions ()
161
+
162
+ self .conf ['data' ] = {'organization' : 'github3py' }
163
+ expect (self .repo .create_fork ('github3py' )
164
+ ).isinstance (github3 .repos .Repository )
165
+ self .mock_assertions ()
0 commit comments