@@ -109,27 +109,31 @@ def test_branch(self):
109
109
# assert isinstance(self.git.listdeploykey(id_=self.project_id, key_id=110), dict)
110
110
# assert isinstance(self.git.listdeploykeys(id_=self.project_id), list)
111
111
#
112
- # def test_snippets(self):
113
- # self.assertTrue(self.git.createsnippet(1, "test", "test", "codeee"))
114
- # assert isinstance(self.git.getsnippets(1), list)
115
- # assert isinstance(self.git.getsnippet(1, self.git.getsnippets(1)[0]['id']), dict)
116
- # self.assertTrue(self.git.deletesnippet(1, self.git.getsnippets(1)[0]['id']))
117
-
118
- # def test_repositories(self):
119
- # assert isinstance(self.git.getrepositories(2), list)
120
- # assert isinstance(self.git.getrepositorybranch(2, "master"), dict)
121
- # assert isinstance(self.git.protectrepositorybranch(2, "master"), dict)
122
- # assert isinstance(self.git.unprotectrepositorybranch(2, "master"), dict)
123
- # assert isinstance(self.git.listrepositorytags(2), list)
124
- # assert isinstance(self.git.listrepositorycommits(2), list)
125
- # assert isinstance(self.git.listrepositorycommits(2, page=1), list)
126
- # assert isinstance(self.git.listrepositorycommits(2, per_page=7), list)
127
- # assert isinstance(self.git.listrepositorycommit(2, self.git.listrepositorycommits(2)[0]['id']), dict)
128
- # assert isinstance(self.git.listrepositorycommitdiff(2, self.git.listrepositorycommits(2)[0]['id']), dict)
129
- # assert isinstance(self.git.listrepositorytree(2), list)
130
- # assert isinstance(self.git.listrepositorytree(2, path="docs"), list)
131
- # assert isinstance(self.git.listrepositorytree(2, ref_name="master"), list)
132
- # assert isinstance(str(self.git.getrawblob(2, self.git.listrepositorycommits(2)[0]['id'], "setup.py")), str)
112
+ def test_snippets (self ):
113
+ self .assertTrue (self .git .createsnippet (self .project_id , "test" , "test" , "codeee" ))
114
+ assert isinstance (self .git .getsnippets (self .project_id ), list )
115
+ snippet = self .git .getsnippets (self .project_id )[0 ]
116
+ assert isinstance (self .git .getsnippet (self .project_id , snippet ["id" ]), dict )
117
+ self .assertTrue (self .git .deletesnippet (self .project_id , snippet ["id" ]))
118
+
119
+ def test_repositories (self ):
120
+ assert isinstance (self .git .getrepositories (self .project_id ), list )
121
+ assert isinstance (self .git .getrepositorybranch (self .project_id , "develop" ), dict )
122
+ assert isinstance (self .git .protectrepositorybranch (self .project_id , "develop" ), dict )
123
+ assert isinstance (self .git .unprotectrepositorybranch (self .project_id , "develop" ), dict )
124
+ assert isinstance (self .git .listrepositorytags (self .project_id ), list )
125
+ assert isinstance (self .git .listrepositorycommits (self .project_id ), list )
126
+ assert isinstance (self .git .listrepositorycommits (self .project_id , page = 1 ), list )
127
+ assert isinstance (self .git .listrepositorycommits (self .project_id , per_page = 7 ), list )
128
+ commit = self .git .listrepositorycommits (self .project_id )[0 ]
129
+ assert isinstance (self .git .listrepositorycommit (self .project_id , commit ["id" ]), dict )
130
+ assert isinstance (self .git .listrepositorycommitdiff (self .project_id , commit ["id" ]), list )
131
+ assert isinstance (self .git .listrepositorytree (self .project_id ), list )
132
+ assert isinstance (self .git .listrepositorytree (self .project_id , path = "docs" ), list )
133
+ assert isinstance (self .git .listrepositorytree (self .project_id , ref_name = "develop" ), list )
134
+ assert isinstance (str (self .git .getrawblob (self .project_id ,
135
+ self .git .listrepositorycommits (self .project_id )[0 ]['id' ],
136
+ "setup.py" )), str )
133
137
#
134
138
# def test_search(self):
135
139
# assert isinstance(self.git.searchproject("gitlab"), list)
@@ -143,5 +147,4 @@ def test_branch(self):
143
147
def test_group (self ):
144
148
self .assertTrue (self .git .creategroup ("test_group" , "test_group" ))
145
149
assert isinstance (self .git .getgroups (), list )
146
- print (self .git .getgroups ())
147
150
self .assertTrue (self .git .deletegroup (group_id = self .git .getgroups ()[0 ]["id" ]))
0 commit comments