◐ Shell
reader mode source ↗
Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
23 changes: 23 additions & 0 deletions gitlab/v4/objects/epics.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from typing import Any, TYPE_CHECKING

from gitlab import exceptions as exc
from gitlab import types
from gitlab.base import RESTObject
Expand Down Expand Up @@ -29,6 +30,28 @@ class GroupEpic(ObjectDeleteMixin, SaveMixin, RESTObject):
resourcelabelevents: GroupEpicResourceLabelEventManager
notes: GroupEpicNoteManager


class GroupEpicManager(CRUDMixin[GroupEpic]):
_path = "/groups/{group_id}/epics"
Expand Down
60 changes: 60 additions & 0 deletions tests/functional/api/test_epics.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
import pytest

pytestmark = pytest.mark.gitlab_premium


Expand Up @@ -32,3 +41,54 @@ def test_epic_notes(epic):
epic.notes.create({"body": "Test note"})
new_notes = epic.notes.list(get_all=True)
assert len(new_notes) == (len(notes) + 1), f"{new_notes} {notes}"
91 changes: 91 additions & 0 deletions tests/unit/mixins/test_mixin_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
GetMixin,
GetWithoutIdMixin,
ListMixin,
RefreshMixin,
SaveMixin,
SetMixin,
Expand Down Expand Up @@ -421,6 +422,27 @@ class M(UpdateMixin, FakeManager):
assert responses.assert_call_count(url, 1) is True


@responses.activate
def test_delete_mixin(gl):
class M(DeleteMixin, FakeManager):
Expand All @@ -440,6 +462,25 @@ class M(DeleteMixin, FakeManager):
assert responses.assert_call_count(url, 1) is True


@responses.activate
def test_save_mixin(gl):
class M(UpdateMixin, FakeManager):
Expand All @@ -466,6 +507,32 @@ class TestClass(SaveMixin, base.RESTObject):
assert responses.assert_call_count(url, 1) is True


@responses.activate
def test_save_mixin_without_new_data(gl):
class M(UpdateMixin, FakeManager):
Expand All @@ -485,6 +552,30 @@ class TestClass(SaveMixin, base.RESTObject):
assert responses.assert_call_count(url, 0) is True


@responses.activate
def test_set_mixin(gl):
class M(SetMixin, FakeManager):
Expand Down
Loading
Toggle all file notes Toggle all file annotations