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

Commitdc6cf5f

Browse files
committed
Finish pep8-ing the tests
1 parentc14c5f8 commitdc6cf5f

File tree

6 files changed

+37
-26
lines changed

6 files changed

+37
-26
lines changed

‎tests/test_events.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ class TestPayloadHandlers(TestCase):
4141
deftest_commitcomment(self):
4242
comment= {'comment':load('repo_comment')}
4343
comment=github3.events._commitcomment(comment)
44-
assertisinstance(comment['comment'],github3.repos.comment.RepoComment)
44+
assertisinstance(comment['comment'],
45+
github3.repos.comment.RepoComment)
4546

4647
deftest_follow(self):
4748
f= {'target':load('user')}

‎tests/test_gists.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
importsys
2-
ifsys.version_info< (3,0):
3-
importunittest2asunittest
4-
else:
5-
importunittest
61
importgithub3
72
fromgithub3importgists
83
fromtests.utilsimport (BaseCase,load)
@@ -35,7 +30,8 @@ def test_create_comment(self):
3530
assertself.gist.create_comment(None)isNone
3631
assertself.gist.create_comment('')isNone
3732
self.not_called()
38-
assertisinstance(self.gist.create_comment('bar'),gists.comment.GistComment)
33+
assertisinstance(self.gist.create_comment('bar'),
34+
gists.comment.GistComment)
3935
self.mock_assertions()
4036

4137
deftest_delete(self):

‎tests/test_github.py

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,8 @@ def test_is_starred(self):
179179
self.response(None,204)
180180
self.get('https://api.github.com/user/starred/user/repo')
181181

182-
self.assertRaises(github3.GitHubError,self.g.is_starred,'user','repo')
182+
self.assertRaises(github3.GitHubError,self.g.is_starred,
183+
'user','repo')
183184

184185
self.login()
185186

@@ -193,7 +194,8 @@ def test_is_subscribed(self):
193194
self.response(None,204)
194195
self.get('https://api.github.com/user/subscriptions/user/repo')
195196

196-
self.assertRaises(github3.GitHubError,self.g.is_subscribed,'user','repo')
197+
self.assertRaises(github3.GitHubError,self.g.is_subscribed,
198+
'user','repo')
197199

198200
self.login()
199201
assertself.g.is_subscribed(None,None)isFalse
@@ -382,7 +384,8 @@ def test_iter_org_issues(self):
382384
self.get('https://api.github.com/orgs/github3py/issues')
383385
self.conf.update(params={})
384386

385-
self.assertRaises(github3.GitHubError,self.g.iter_org_issues,'github3py')
387+
self.assertRaises(github3.GitHubError,self.g.iter_org_issues,
388+
'github3py')
386389

387390
self.login()
388391
i=next(self.g.iter_org_issues('github3py'))
@@ -412,7 +415,8 @@ def test_iter_issues(self):
412415
'sort':'created','direction':'asc',
413416
'since':'2012-05-20T23:10:27Z'}
414417
self.conf.update(params=params)
415-
assertisinstance(next(self.g.iter_issues(**params)),github3.issues.Issue)
418+
assertisinstance(next(self.g.iter_issues(**params)),
419+
github3.issues.Issue)
416420
self.mock_assertions()
417421

418422
deftest_iter_user_issues(self):
@@ -423,14 +427,16 @@ def test_iter_user_issues(self):
423427
self.assertRaises(github3.GitHubError,self.g.iter_user_issues)
424428

425429
self.login()
426-
assertisinstance(next(self.g.iter_user_issues()),github3.issues.Issue)
430+
assertisinstance(next(self.g.iter_user_issues()),
431+
github3.issues.Issue)
427432
self.mock_assertions()
428433

429434
params= {'filter':'assigned','state':'closed','labels':'bug',
430435
'sort':'created','direction':'asc',
431436
'since':'2012-05-20T23:10:27Z'}
432437
self.conf.update(params=params)
433-
assertisinstance(next(self.g.iter_user_issues(**params)),github3.issues.Issue)
438+
assertisinstance(next(self.g.iter_user_issues(**params)),
439+
github3.issues.Issue)
434440
self.mock_assertions()
435441

436442
deftest_iter_repo_issues(self):
@@ -464,7 +470,8 @@ def test_iter_orgs(self):
464470
self.response('org',_iter=True)
465471
self.get('https://api.github.com/users/login/orgs')
466472

467-
assertisinstance(next(self.g.iter_orgs('login')),github3.orgs.Organization)
473+
assertisinstance(next(self.g.iter_orgs('login')),
474+
github3.orgs.Organization)
468475
self.mock_assertions()
469476

470477
self.get('https://api.github.com/user/orgs')
@@ -483,7 +490,8 @@ def test_iter_repos(self):
483490
assertisinstance(next(self.g.iter_repos()),github3.repos.Repository)
484491
self.mock_assertions()
485492

486-
assertisinstance(next(self.g.iter_repos('sigmavirus24')),github3.repos.Repository)
493+
assertisinstance(next(self.g.iter_repos('sigmavirus24')),
494+
github3.repos.Repository)
487495
self.mock_assertions()
488496

489497
self.conf.update(params={'type':'all','direction':'desc'})
@@ -502,7 +510,8 @@ def test_iter_user_repos(self):
502510
self.conf.update(params={"sort":"created"})
503511
self.get('https://api.github.com/users/sigmavirus24/repos')
504512

505-
assertisinstance(next(self.g.iter_user_repos('sigmavirus24',sort="created")),
513+
assertisinstance(next(self.g.iter_user_repos('sigmavirus24',
514+
sort="created")),
506515
github3.repos.Repository)
507516
self.mock_assertions()
508517

@@ -610,17 +619,19 @@ def test_pubsubhubbub(self):
610619
('hub.callback','https://localhost/post')]
611620
self.conf= {}
612621

613-
self.assertRaises(github3.GitHubError,self.g.pubsubhubbub,'','','')
622+
pubsubhubbub=self.g.pubsubhubbub
623+
624+
self.assertRaises(github3.GitHubError,pubsubhubbub,'','','')
614625

615626
self.login()
616-
assertself.g.pubsubhubbub('','','')isFalse
627+
assertpubsubhubbub('','','')isFalse
617628
self.not_called()
618629

619-
assertself.g.pubsubhubbub('foo','https://example.com','foo')isFalse
630+
assertpubsubhubbub('foo','https://example.com','foo')isFalse
620631
self.not_called()
621632

622633
d=dict([(k[4:],v)fork,vinbody])
623-
assertself.g.pubsubhubbub(**d)isTrue
634+
assertpubsubhubbub(**d)isTrue
624635
_,kwargs=self.request.call_args
625636

626637
assert'data'inkwargs
@@ -629,7 +640,7 @@ def test_pubsubhubbub(self):
629640

630641
d['secret']='secret'
631642
body.append(('hub.secret','secret'))
632-
assertself.g.pubsubhubbub(**d)
643+
assertpubsubhubbub(**d)
633644
_,kwargs=self.request.call_args
634645
assert'data'inkwargs
635646
assertbody==kwargs['data']
@@ -819,7 +830,8 @@ def test_unsubscribe(self):
819830
'sigmavirus24/github3.py')
820831
self.conf= {}
821832

822-
self.assertRaises(github3.GitHubError,self.g.unsubscribe,'foo','bar')
833+
self.assertRaises(github3.GitHubError,self.g.unsubscribe,
834+
'foo','bar')
823835

824836
self.login()
825837
assertself.g.unsubscribe(None,None)isFalse

‎tests/test_issues.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ def test_issue_137(self):
323323
self.assertEqual(i.repository, ("sigmavirus24","github3.py"))
324324

325325

326-
327326
classTestIssueEvent(BaseCase):
328327
defsetUp(self):
329328
super(TestIssueEvent,self).setUp()

‎tests/test_notifications.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,14 +48,16 @@ def test_set_subscription(self):
4848
self.put(self.api+'/subscription')
4949
self.conf= {'data': {'subscribed':True,'ignored':False}}
5050

51-
assertisinstance(self.thread.set_subscription(True,False),github3.notifications.Subscription)
51+
assertisinstance(self.thread.set_subscription(True,False),
52+
github3.notifications.Subscription)
5253
self.mock_assertions()
5354

5455
deftest_subscription(self):
5556
self.response('subscription')
5657
self.get(self.api+'/subscription')
5758

58-
assertisinstance(self.thread.subscription(),github3.notifications.Subscription)
59+
assertisinstance(self.thread.subscription(),
60+
github3.notifications.Subscription)
5961
self.mock_assertions()
6062

6163

‎tests/test_orgs.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,8 @@ def test_remove_member(self):
336336
self.mock_assertions()
337337

338338
deftest_remove_repo(self):
339-
self.assertRaises(github3.GitHubError,self.org.remove_repo,None,None)
339+
self.assertRaises(github3.GitHubError,self.org.remove_repo,
340+
None,None)
340341

341342
self.login()
342343
withpatch.object(github3.orgs.Organization,'iter_teams')asit:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp