Skip to content

Commit

Permalink
Add basic testing forr EE endpoints
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Gauvain Pocentek committed Jun 8, 2018
1 parent 0b45afb commit c88333b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions tools/ee-test.py
@@ -0,0 +1,29 @@
#!/usr/bin/env python

import gitlab


PROJECT_NAME = 'root/project1'

def start_log(message):
print('Testing %s... ' % message, end='')


def end_log():
print('OK')


gl = gitlab.Gitlab.from_config('ee')
project = gl.projects.get(PROJECT_NAME)

start_log('MR approvals')
approval = project.approvals.get()
v = approval.reset_approvals_on_push
approval.reset_approvals_on_push = not v
approval.save()
approval = project.approvals.get()
assert(v != approval.reset_approvals_on_push)
project.approvals.set_approvers([1], [])
approval = project.approvals.get()
assert(approval.approvers[0]['user']['id'] == 1)
end_log()

0 comments on commit c88333b

Please sign in to comment.