summaryrefslogtreecommitdiff
path: root/tests/unit/objects/conftest.py
diff options
context:
space:
mode:
authorNejc Habjan <hab.nejc@gmail.com>2021-12-01 01:04:53 +0100
committerGitHub <noreply@github.com>2021-12-01 01:04:53 +0100
commit8d76826fa64460e504acc5924f859f8dbc246b42 (patch)
tree083fefada982c795e2415092794db429abb0c184 /tests/unit/objects/conftest.py
parent5a1678f43184bd459132102cc13cf8426fe0449d (diff)
parent86ab04e54ea4175f10053decfad5086cda7aa024 (diff)
downloadgitlab-master.tar.gz
Merge pull request #1723 from python-gitlab/jlvillal/dead_mastermaster
Close-out `master` branch
Diffstat (limited to 'tests/unit/objects/conftest.py')
-rw-r--r--tests/unit/objects/conftest.py70
1 files changed, 0 insertions, 70 deletions
diff --git a/tests/unit/objects/conftest.py b/tests/unit/objects/conftest.py
deleted file mode 100644
index d8a40d9..0000000
--- a/tests/unit/objects/conftest.py
+++ /dev/null
@@ -1,70 +0,0 @@
-"""Common mocks for resources in gitlab.v4.objects"""
-
-import re
-
-import pytest
-import responses
-
-
-@pytest.fixture
-def binary_content():
- return b"binary content"
-
-
-@pytest.fixture
-def accepted_content():
- return {"message": "202 Accepted"}
-
-
-@pytest.fixture
-def created_content():
- return {"message": "201 Created"}
-
-
-@pytest.fixture
-def no_content():
- return {"message": "204 No Content"}
-
-
-@pytest.fixture
-def resp_export(accepted_content, binary_content):
- """Common fixture for group and project exports."""
- export_status_content = {
- "id": 1,
- "description": "Itaque perspiciatis minima aspernatur",
- "name": "Gitlab Test",
- "name_with_namespace": "Gitlab Org / Gitlab Test",
- "path": "gitlab-test",
- "path_with_namespace": "gitlab-org/gitlab-test",
- "created_at": "2017-08-29T04:36:44.383Z",
- "export_status": "finished",
- "_links": {
- "api_url": "https://gitlab.test/api/v4/projects/1/export/download",
- "web_url": "https://gitlab.test/gitlab-test/download_export",
- },
- }
-
- with responses.RequestsMock(assert_all_requests_are_fired=False) as rsps:
- rsps.add(
- method=responses.POST,
- url=re.compile(r".*/api/v4/(groups|projects)/1/export"),
- json=accepted_content,
- content_type="application/json",
- status=202,
- )
- rsps.add(
- method=responses.GET,
- url=re.compile(r".*/api/v4/(groups|projects)/1/export/download"),
- body=binary_content,
- content_type="application/octet-stream",
- status=200,
- )
- # Currently only project export supports status checks
- rsps.add(
- method=responses.GET,
- url="http://localhost/api/v4/projects/1/export",
- json=export_status_content,
- content_type="application/json",
- status=200,
- )
- yield rsps