@@ -179,7 +179,8 @@ def test_is_starred(self):
179
179
self .response (None ,204 )
180
180
self .get ('https://api.github.com/user/starred/user/repo' )
181
181
182
- self .assertRaises (github3 .GitHubError ,self .g .is_starred ,'user' ,'repo' )
182
+ self .assertRaises (github3 .GitHubError ,self .g .is_starred ,
183
+ 'user' ,'repo' )
183
184
184
185
self .login ()
185
186
@@ -193,7 +194,8 @@ def test_is_subscribed(self):
193
194
self .response (None ,204 )
194
195
self .get ('https://api.github.com/user/subscriptions/user/repo' )
195
196
196
- self .assertRaises (github3 .GitHubError ,self .g .is_subscribed ,'user' ,'repo' )
197
+ self .assertRaises (github3 .GitHubError ,self .g .is_subscribed ,
198
+ 'user' ,'repo' )
197
199
198
200
self .login ()
199
201
assert self .g .is_subscribed (None ,None )is False
@@ -382,7 +384,8 @@ def test_iter_org_issues(self):
382
384
self .get ('https://api.github.com/orgs/github3py/issues' )
383
385
self .conf .update (params = {})
384
386
385
- self .assertRaises (github3 .GitHubError ,self .g .iter_org_issues ,'github3py' )
387
+ self .assertRaises (github3 .GitHubError ,self .g .iter_org_issues ,
388
+ 'github3py' )
386
389
387
390
self .login ()
388
391
i = next (self .g .iter_org_issues ('github3py' ))
@@ -412,7 +415,8 @@ def test_iter_issues(self):
412
415
'sort' :'created' ,'direction' :'asc' ,
413
416
'since' :'2012-05-20T23:10:27Z' }
414
417
self .conf .update (params = params )
415
- assert isinstance (next (self .g .iter_issues (** params )),github3 .issues .Issue )
418
+ assert isinstance (next (self .g .iter_issues (** params )),
419
+ github3 .issues .Issue )
416
420
self .mock_assertions ()
417
421
418
422
def test_iter_user_issues (self ):
@@ -423,14 +427,16 @@ def test_iter_user_issues(self):
423
427
self .assertRaises (github3 .GitHubError ,self .g .iter_user_issues )
424
428
425
429
self .login ()
426
- assert isinstance (next (self .g .iter_user_issues ()),github3 .issues .Issue )
430
+ assert isinstance (next (self .g .iter_user_issues ()),
431
+ github3 .issues .Issue )
427
432
self .mock_assertions ()
428
433
429
434
params = {'filter' :'assigned' ,'state' :'closed' ,'labels' :'bug' ,
430
435
'sort' :'created' ,'direction' :'asc' ,
431
436
'since' :'2012-05-20T23:10:27Z' }
432
437
self .conf .update (params = params )
433
- assert isinstance (next (self .g .iter_user_issues (** params )),github3 .issues .Issue )
438
+ assert isinstance (next (self .g .iter_user_issues (** params )),
439
+ github3 .issues .Issue )
434
440
self .mock_assertions ()
435
441
436
442
def test_iter_repo_issues (self ):
@@ -464,7 +470,8 @@ def test_iter_orgs(self):
464
470
self .response ('org' ,_iter = True )
465
471
self .get ('https://api.github.com/users/login/orgs' )
466
472
467
- assert isinstance (next (self .g .iter_orgs ('login' )),github3 .orgs .Organization )
473
+ assert isinstance (next (self .g .iter_orgs ('login' )),
474
+ github3 .orgs .Organization )
468
475
self .mock_assertions ()
469
476
470
477
self .get ('https://api.github.com/user/orgs' )
@@ -483,7 +490,8 @@ def test_iter_repos(self):
483
490
assert isinstance (next (self .g .iter_repos ()),github3 .repos .Repository )
484
491
self .mock_assertions ()
485
492
486
- assert isinstance (next (self .g .iter_repos ('sigmavirus24' )),github3 .repos .Repository )
493
+ assert isinstance (next (self .g .iter_repos ('sigmavirus24' )),
494
+ github3 .repos .Repository )
487
495
self .mock_assertions ()
488
496
489
497
self .conf .update (params = {'type' :'all' ,'direction' :'desc' })
@@ -502,7 +510,8 @@ def test_iter_user_repos(self):
502
510
self .conf .update (params = {"sort" :"created" })
503
511
self .get ('https://api.github.com/users/sigmavirus24/repos' )
504
512
505
- assert isinstance (next (self .g .iter_user_repos ('sigmavirus24' ,sort = "created" )),
513
+ assert isinstance (next (self .g .iter_user_repos ('sigmavirus24' ,
514
+ sort = "created" )),
506
515
github3 .repos .Repository )
507
516
self .mock_assertions ()
508
517
@@ -610,17 +619,19 @@ def test_pubsubhubbub(self):
610
619
('hub.callback' ,'https://localhost/post' )]
611
620
self .conf = {}
612
621
613
- self .assertRaises (github3 .GitHubError ,self .g .pubsubhubbub ,'' ,'' ,'' )
622
+ pubsubhubbub = self .g .pubsubhubbub
623
+
624
+ self .assertRaises (github3 .GitHubError ,pubsubhubbub ,'' ,'' ,'' )
614
625
615
626
self .login ()
616
- assert self . g . pubsubhubbub ('' ,'' ,'' )is False
627
+ assert pubsubhubbub ('' ,'' ,'' )is False
617
628
self .not_called ()
618
629
619
- assert self . g . pubsubhubbub ('foo' ,'https://example.com' ,'foo' )is False
630
+ assert pubsubhubbub ('foo' ,'https://example.com' ,'foo' )is False
620
631
self .not_called ()
621
632
622
633
d = dict ([(k [4 :],v )for k ,v in body ])
623
- assert self . g . pubsubhubbub (** d )is True
634
+ assert pubsubhubbub (** d )is True
624
635
_ ,kwargs = self .request .call_args
625
636
626
637
assert 'data' in kwargs
@@ -629,7 +640,7 @@ def test_pubsubhubbub(self):
629
640
630
641
d ['secret' ]= 'secret'
631
642
body .append (('hub.secret' ,'secret' ))
632
- assert self . g . pubsubhubbub (** d )
643
+ assert pubsubhubbub (** d )
633
644
_ ,kwargs = self .request .call_args
634
645
assert 'data' in kwargs
635
646
assert body == kwargs ['data' ]
@@ -819,7 +830,8 @@ def test_unsubscribe(self):
819
830
'sigmavirus24/github3.py' )
820
831
self .conf = {}
821
832
822
- self .assertRaises (github3 .GitHubError ,self .g .unsubscribe ,'foo' ,'bar' )
833
+ self .assertRaises (github3 .GitHubError ,self .g .unsubscribe ,
834
+ 'foo' ,'bar' )
823
835
824
836
self .login ()
825
837
assert self .g .unsubscribe (None ,None )is False