summaryrefslogtreecommitdiff
path: root/gitlab
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab')
-rw-r--r--gitlab/objects.py1
-rw-r--r--gitlab/tests/test_manager.py6
2 files changed, 4 insertions, 3 deletions
diff --git a/gitlab/objects.py b/gitlab/objects.py
index 98c1a32..0def183 100644
--- a/gitlab/objects.py
+++ b/gitlab/objects.py
@@ -2276,6 +2276,7 @@ class ProjectRunnerManager(BaseManager):
class Project(GitlabObject):
_url = '/projects'
_constructorTypes = {'owner': 'User', 'namespace': 'Group'}
+ optionalListAttrs = ['search']
requiredCreateAttrs = ['name']
optionalCreateAttrs = ['path', 'namespace_id', 'description',
'issues_enabled', 'merge_requests_enabled',
diff --git a/gitlab/tests/test_manager.py b/gitlab/tests/test_manager.py
index 59987a7..16e13f2 100644
--- a/gitlab/tests/test_manager.py
+++ b/gitlab/tests/test_manager.py
@@ -215,8 +215,8 @@ class TestGitlabManager(unittest.TestCase):
def test_project_manager_search(self):
mgr = ProjectManager(self.gitlab)
- @urlmatch(scheme="http", netloc="localhost",
- path="/api/v3/projects/search/foo", method="get")
+ @urlmatch(scheme="http", netloc="localhost", path="/api/v3/projects",
+ query="search=foo", method="get")
def resp_get_all(url, request):
headers = {'content-type': 'application/json'}
content = ('[{"name": "foo1", "id": 1}, '
@@ -225,7 +225,7 @@ class TestGitlabManager(unittest.TestCase):
return response(200, content, headers, None, 5, request)
with HTTMock(resp_get_all):
- data = mgr.search('foo')
+ data = mgr.list(search='foo')
self.assertEqual(type(data), list)
self.assertEqual(2, len(data))
self.assertEqual(type(data[0]), Project)