From e7b2d6c873f0bfd502d06c9bd239cedc465e51c5 Mon Sep 17 00:00:00 2001 From: Nejc Habjan Date: Sun, 5 Apr 2020 22:58:04 +0200 Subject: test(api): add tests for group export/import API --- gitlab/tests/objects/test_projects.py | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) (limited to 'gitlab/tests/objects/test_projects.py') diff --git a/gitlab/tests/objects/test_projects.py b/gitlab/tests/objects/test_projects.py index d87f759..1c2347a 100644 --- a/gitlab/tests/objects/test_projects.py +++ b/gitlab/tests/objects/test_projects.py @@ -10,21 +10,7 @@ from gitlab import * # noqa from gitlab.v4.objects import * # noqa from httmock import HTTMock, urlmatch, response, with_httmock # noqa - -headers = {"content-type": "application/json"} -binary_content = b"binary content" - - -@urlmatch( - scheme="http", netloc="localhost", path="/api/v4/projects/1/export", method="post", -) -def resp_create_export(url, request): - """Common mock for Project Export tests.""" - content = """{ - "message": "202 Accepted" - }""" - content = content.encode("utf-8") - return response(202, content, headers, None, 25, request) +from .mocks import * # noqa @urlmatch( @@ -51,19 +37,6 @@ def resp_export_status(url, request): return response(200, content, headers, None, 25, request) -@urlmatch( - scheme="http", - netloc="localhost", - path="/api/v4/projects/1/export/download", - method="get", -) -def resp_download_export(url, request): - """Mock for Project Export Download GET response.""" - headers = {"content-type": "application/octet-stream"} - content = binary_content - return response(200, content, headers, None, 25, request) - - @urlmatch( scheme="http", netloc="localhost", path="/api/v4/projects/import", method="post", ) -- cgit v1.2.1