Skip to content

Commit c88333b

Browse files
author
Gauvain Pocentek
committed
Add basic testing forr EE endpoints
Today we don't have a solution for easily deploying an EE instance so using the functional tools is not possible. This patch provides a testing script that needs to be run against a private EE instance.
1 parent 0b45afb commit c88333b

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

tools/ee-test.py

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
#!/usr/bin/env python
2+
3+
import gitlab
4+
5+
6+
PROJECT_NAME = 'root/project1'
7+
8+
def start_log(message):
9+
print('Testing %s... ' % message, end='')
10+
11+
12+
def end_log():
13+
print('OK')
14+
15+
16+
gl = gitlab.Gitlab.from_config('ee')
17+
project = gl.projects.get(PROJECT_NAME)
18+
19+
start_log('MR approvals')
20+
approval = project.approvals.get()
21+
v = approval.reset_approvals_on_push
22+
approval.reset_approvals_on_push = not v
23+
approval.save()
24+
approval = project.approvals.get()
25+
assert(v != approval.reset_approvals_on_push)
26+
project.approvals.set_approvers([1], [])
27+
approval = project.approvals.get()
28+
assert(approval.approvers[0]['user']['id'] == 1)
29+
end_log()

0 commit comments

Comments
 (0)