summaryrefslogtreecommitdiff
path: root/tests/functional/cli/conftest.py
diff options
context:
space:
mode:
authorJohn L. Villalovos <john@sodarock.com>2022-01-08 14:15:03 -0800
committerJohn L. Villalovos <john@sodarock.com>2022-01-08 14:15:03 -0800
commit79b1cc0b1be1e9986d9d3dae68db0bff981014fb (patch)
tree05a8cda1d7d038c247ab9e4208b775ed39bd243b /tests/functional/cli/conftest.py
parentc9ed3ddc1253c828dc877dcd55000d818c297ee7 (diff)
downloadgitlab-jlvillal/parent_attrs.tar.gz
fix: cli: url-encode path components of the URLjlvillal/parent_attrs
In the CLI we need to make sure the components put into the path portion of the URL are url-encoded. Otherwise they will be interpreted as part of the path. For example can specify the project ID as a path, but in the URL it must be url-encoded or it doesn't work. Also stop adding the components of the path as query parameters in the URL. Closes: #783 Closes: #1498
Diffstat (limited to 'tests/functional/cli/conftest.py')
-rw-r--r--tests/functional/cli/conftest.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/functional/cli/conftest.py b/tests/functional/cli/conftest.py
index ba94dcb..4311339 100644
--- a/tests/functional/cli/conftest.py
+++ b/tests/functional/cli/conftest.py
@@ -1,4 +1,7 @@
import pytest
+import responses
+
+from gitlab.const import DEFAULT_URL
@pytest.fixture
@@ -19,3 +22,14 @@ def gitlab_cli(script_runner, gitlab_config):
return script_runner.run(*command)
return _gitlab_cli
+
+
+@pytest.fixture
+def resp_get_project():
+ return {
+ "method": responses.GET,
+ "url": f"{DEFAULT_URL}/api/v4/projects/1",
+ "json": {"name": "name", "path": "test-path", "id": 1},
+ "content_type": "application/json",
+ "status": 200,
+ }