summaryrefslogtreecommitdiff
path: root/tools/python_test_v4.py
diff options
context:
space:
mode:
authorGauvain Pocentek <gauvain@pocentek.net>2018-05-21 15:06:44 +0200
committerGauvain Pocentek <gauvain@pocentek.net>2018-05-21 15:06:44 +0200
commitb5f9616f21b7dcdf166033d0dba09b3dd2289849 (patch)
tree6e12c39667ea59b11625d1875bf008bc542f4ef1 /tools/python_test_v4.py
parent42007ec651e6203f608484e6de899907196a808f (diff)
downloadgitlab-b5f9616f21b7dcdf166033d0dba09b3dd2289849.tar.gz
Add support for project import/export
Fixes #471
Diffstat (limited to 'tools/python_test_v4.py')
-rw-r--r--tools/python_test_v4.py24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/python_test_v4.py b/tools/python_test_v4.py
index c11e567..01de5bd 100644
--- a/tools/python_test_v4.py
+++ b/tools/python_test_v4.py
@@ -678,3 +678,27 @@ assert 'Retry later' in error_message
[current_project.delete() for current_project in projects]
settings.throttle_authenticated_api_enabled = False
settings.save()
+
+# project import/export
+ex = admin_project.exports.create({})
+ex.refresh()
+count = 0
+while ex.export_status != 'finished':
+ time.sleep(1)
+ ex.refresh()
+ count += 1
+ if count == 10:
+ raise Exception('Project export taking too much time')
+with open('/tmp/gitlab-export.tgz', 'wb') as f:
+ ex.download(streamed=True, action=f.write)
+
+output = gl.projects.import_project(open('/tmp/gitlab-export.tgz', 'rb'),
+ 'imported_project')
+project_import = gl.projects.get(output['id'], lazy=True).imports.get()
+count = 0
+while project_import.import_status != 'finished':
+ time.sleep(1)
+ project_import.refresh()
+ count += 1
+ if count == 10:
+ raise Exception('Project import taking too much time')