summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gitlab/v4/objects/runners.py9
-rw-r--r--tests/unit/objects/test_runners.py15
2 files changed, 7 insertions, 17 deletions
diff --git a/gitlab/v4/objects/runners.py b/gitlab/v4/objects/runners.py
index a32dc84..ec8153f 100644
--- a/gitlab/v4/objects/runners.py
+++ b/gitlab/v4/objects/runners.py
@@ -3,9 +3,10 @@ from gitlab import exceptions as exc
from gitlab import types
from gitlab.base import RequiredOptional, RESTManager, RESTObject
from gitlab.mixins import (
+ CreateMixin,
CRUDMixin,
+ DeleteMixin,
ListMixin,
- NoUpdateMixin,
ObjectDeleteMixin,
SaveMixin,
)
@@ -114,11 +115,11 @@ class RunnerManager(CRUDMixin, RESTManager):
self.gitlab.http_post(path, post_data=post_data, **kwargs)
-class GroupRunner(ObjectDeleteMixin, RESTObject):
+class GroupRunner(RESTObject):
pass
-class GroupRunnerManager(NoUpdateMixin, RESTManager):
+class GroupRunnerManager(ListMixin, RESTManager):
_path = "/groups/%(group_id)s/runners"
_obj_cls = GroupRunner
_from_parent_attrs = {"group_id": "id"}
@@ -131,7 +132,7 @@ class ProjectRunner(ObjectDeleteMixin, RESTObject):
pass
-class ProjectRunnerManager(NoUpdateMixin, RESTManager):
+class ProjectRunnerManager(CreateMixin, DeleteMixin, ListMixin, RESTManager):
_path = "/projects/%(project_id)s/runners"
_obj_cls = ProjectRunner
_from_parent_attrs = {"project_id": "id"}
diff --git a/tests/unit/objects/test_runners.py b/tests/unit/objects/test_runners.py
index c54ecdf..1f3dc48 100644
--- a/tests/unit/objects/test_runners.py
+++ b/tests/unit/objects/test_runners.py
@@ -143,7 +143,7 @@ def resp_runner_register():
@pytest.fixture
def resp_runner_enable():
with responses.RequestsMock() as rsps:
- pattern = re.compile(r".*?(projects|groups)/1/runners")
+ pattern = re.compile(r".*?projects/1/runners")
rsps.add(
method=responses.POST,
url=pattern,
@@ -176,7 +176,7 @@ def resp_runner_delete():
@pytest.fixture
def resp_runner_disable():
with responses.RequestsMock() as rsps:
- pattern = re.compile(r".*?/(groups|projects)/1/runners/6")
+ pattern = re.compile(r".*?/projects/1/runners/6")
rsps.add(
method=responses.DELETE,
url=pattern,
@@ -252,10 +252,6 @@ def test_disable_project_runner(gl: gitlab.Gitlab, resp_runner_disable):
gl.projects.get(1, lazy=True).runners.delete(6)
-def test_disable_group_runner(gl: gitlab.Gitlab, resp_runner_disable):
- gl.groups.get(1, lazy=True).runners.delete(6)
-
-
def test_enable_project_runner(gl: gitlab.Gitlab, resp_runner_enable):
runner = gl.projects.get(1, lazy=True).runners.create({"runner_id": 6})
assert runner.active is True
@@ -263,13 +259,6 @@ def test_enable_project_runner(gl: gitlab.Gitlab, resp_runner_enable):
assert runner.name == "test-name"
-def test_enable_group_runner(gl: gitlab.Gitlab, resp_runner_enable):
- runner = gl.groups.get(1, lazy=True).runners.create({"runner_id": 6})
- assert runner.active is True
- assert runner.id == 6
- assert runner.name == "test-name"
-
-
def test_verify_runner(gl: gitlab.Gitlab, resp_runner_verify):
gl.runners.verify("token")