Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit5d8ef57

Browse files
committed
Release 0.1 and bring coverage to 51%
1 parent3ceb856 commit5d8ef57

File tree

3 files changed

+43
-1
lines changed

3 files changed

+43
-1
lines changed

‎HISTORY.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
History/Changelog
22
=================
33

4-
0.2:xxxx-xx-xx
4+
0.2:2012-11-21
55
---------------
66

77
MAJOR API CHANGES:
@@ -17,6 +17,7 @@ MAJOR API CHANGES:
1717
- Changed the way ``Repository.edit`` works courtesy of Kristian Glass
1818
(@doismellburning)
1919
- Changed ``Repository.contents`` behaviour when acting on a 404.
20+
- 50% test coverage via mock tests
2021

2122
0.1: 2012-11-13
2223
---------------

‎tests/json/blob

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"url": "https://api.github.com/repos/sigmavirus24/github3.py/git/blobs/30f2c645388832f70d37ab2b47eb9ea527e5ae7c", "content": "VGVzdCBibG9i\n", "size": 9, "encoding": "base64", "sha": "30f2c645388832f70d37ab2b47eb9ea527e5ae7c"}

‎tests/test_repos.py

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
importgithub3
2+
fromtests.utilsimport (generate_response,expect,BaseCase,load)
3+
4+
5+
classTestRepository(BaseCase):
6+
def__init__(self,methodName='runTest'):
7+
super(TestRepository,self).__init__(methodName)
8+
self.repo=github3.repos.Repository(load('repo'))
9+
10+
defsetUp(self):
11+
super(TestRepository,self).setUp()
12+
self.repo=github3.repos.Repository(self.repo.to_json(),self.g)
13+
self.api='https://api.github.com/repos/sigmavirus24/github3.py/'
14+
15+
deftest_add_collaborator(self):
16+
self.request.return_value=generate_response('',204)
17+
self.args= ('put',self.api+'collaborators/sigmavirus24')
18+
self.conf= {'headers': {'Content-Length':'0'},'data':None}
19+
20+
withexpect.githuberror():
21+
self.repo.add_collaborator('foo')
22+
23+
self.login()
24+
expect(self.repo.add_collaborator(None)).is_False()
25+
expect(self.repo.add_collaborator('sigmavirus24')).is_True()
26+
self.mock_assertions()
27+
28+
deftest_archive(self):
29+
pass
30+
31+
deftest_blob(self):
32+
self.request.return_value=generate_response('blob',200)
33+
self.args= ('get',
34+
self.api+ ('git/blobs/'
35+
'3ceb856e2f14e9669fed6384e58c9a1590a2314f')
36+
)
37+
38+
expect(self.repo.blob('3ceb856e2f14e9669fed6384e58c9a1590a2314f')
39+
).isinstance(github3.git.Blob)
40+
self.mock_assertions()

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp