@@ -620,7 +620,7 @@ def resp_cont(url, request):
620
620
self .assertEqual (proj .id , 1 )
621
621
self .assertEqual (proj .name , "testproject" )
622
622
623
- def test_Hook (self ):
623
+ def test_hooks (self ):
624
624
@urlmatch (scheme = "http" , netloc = "localhost" , path = "/api/v3/hooks/1" ,
625
625
method = "get" )
626
626
def resp_get_hook (url , request ):
@@ -629,12 +629,12 @@ def resp_get_hook(url, request):
629
629
return response (200 , content , headers , None , 5 , request )
630
630
631
631
with HTTMock (resp_get_hook ):
632
- data = self .gl .Hook ( id = 1 )
632
+ data = self .gl .hooks . get ( 1 )
633
633
self .assertEqual (type (data ), Hook )
634
634
self .assertEqual (data .url , "testurl" )
635
635
self .assertEqual (data .id , 1 )
636
636
637
- def test_Project (self ):
637
+ def test_projects (self ):
638
638
@urlmatch (scheme = "http" , netloc = "localhost" , path = "/api/v3/projects/1" ,
639
639
method = "get" )
640
640
def resp_get_project (url , request ):
@@ -643,12 +643,12 @@ def resp_get_project(url, request):
643
643
return response (200 , content , headers , None , 5 , request )
644
644
645
645
with HTTMock (resp_get_project ):
646
- data = self .gl .Project ( id = 1 )
646
+ data = self .gl .projects . get ( 1 )
647
647
self .assertEqual (type (data ), Project )
648
648
self .assertEqual (data .name , "name" )
649
649
self .assertEqual (data .id , 1 )
650
650
651
- def test_UserProject (self ):
651
+ def test_userprojects (self ):
652
652
@urlmatch (scheme = "http" , netloc = "localhost" ,
653
653
path = "/api/v3/projects/user/2" , method = "get" )
654
654
def resp_get_userproject (url , request ):
@@ -657,10 +657,10 @@ def resp_get_userproject(url, request):
657
657
return response (200 , content , headers , None , 5 , request )
658
658
659
659
with HTTMock (resp_get_userproject ):
660
- self .assertRaises (NotImplementedError , self .gl .UserProject , id = 1 ,
661
- user_id = 2 )
660
+ self .assertRaises (NotImplementedError , self .gl .user_projects . get ,
661
+ 1 , user_id = 2 )
662
662
663
- def test_Group (self ):
663
+ def test_groups (self ):
664
664
@urlmatch (scheme = "http" , netloc = "localhost" , path = "/api/v3/groups/1" ,
665
665
method = "get" )
666
666
def resp_get_group (url , request ):
@@ -670,13 +670,13 @@ def resp_get_group(url, request):
670
670
return response (200 , content , headers , None , 5 , request )
671
671
672
672
with HTTMock (resp_get_group ):
673
- data = self .gl .Group ( id = 1 )
673
+ data = self .gl .groups . get ( 1 )
674
674
self .assertEqual (type (data ), Group )
675
675
self .assertEqual (data .name , "name" )
676
676
self .assertEqual (data .path , "path" )
677
677
self .assertEqual (data .id , 1 )
678
678
679
- def test_Issue (self ):
679
+ def test_issues (self ):
680
680
@urlmatch (scheme = "http" , netloc = "localhost" , path = "/api/v3/issues" ,
681
681
method = "get" )
682
682
def resp_get_issue (url , request ):
@@ -687,11 +687,11 @@ def resp_get_issue(url, request):
687
687
return response (200 , content , headers , None , 5 , request )
688
688
689
689
with HTTMock (resp_get_issue ):
690
- data = self .gl .Issue ( id = 2 )
690
+ data = self .gl .issues . get ( 2 )
691
691
self .assertEqual (data .id , 2 )
692
692
self .assertEqual (data .name , 'other_name' )
693
693
694
- def test_User (self ):
694
+ def test_users (self ):
695
695
@urlmatch (scheme = "http" , netloc = "localhost" , path = "/api/v3/users/1" ,
696
696
method = "get" )
697
697
def resp_get_user (url , request ):
@@ -702,7 +702,23 @@ def resp_get_user(url, request):
702
702
return response (200 , content , headers , None , 5 , request )
703
703
704
704
with HTTMock (resp_get_user ):
705
- user = self .gl .User ( id = 1 )
705
+ user = self .gl .users . get ( 1 )
706
706
self .assertEqual (type (user ), User )
707
707
self .assertEqual (user .name , "name" )
708
708
self .assertEqual (user .id , 1 )
709
+
710
+ def test_teams (self ):
711
+ @urlmatch (scheme = "http" , netloc = "localhost" ,
712
+ path = "/api/v3/user_teams/1" , method = "get" )
713
+ def resp_get_group (url , request ):
714
+ headers = {'content-type' : 'application/json' }
715
+ content = '{"name": "name", "id": 1, "path": "path"}'
716
+ content = content .encode ('utf-8' )
717
+ return response (200 , content , headers , None , 5 , request )
718
+
719
+ with HTTMock (resp_get_group ):
720
+ data = self .gl .teams .get (1 )
721
+ self .assertEqual (type (data ), Team )
722
+ self .assertEqual (data .name , "name" )
723
+ self .assertEqual (data .path , "path" )
724
+ self .assertEqual (data .id , 1 )
0 commit comments