| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent e973729 commit 6e5ef55
4 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -207,6 +207,10 @@ Get the list of iteration events:: | |||
| 207 | 207 | ||
| 208 | 208 | iteration_events = issue.resource_iteration_events.list() | |
| 209 | 209 | ||
| 210 | + Get the list of weight events:: | ||
| 211 | + | ||
| 212 | + weight_events = issue.resource_weight_events.list() | ||
| 213 | + | ||
| 210 | 214 | Issue links | |
| 211 | 215 | =========== | |
| 212 | 216 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,9 @@ | |||
| 16 | 16 | "ProjectIssueResourceMilestoneEventManager", | |
| 17 | 17 | "ProjectIssueResourceStateEvent", | |
| 18 | 18 | "ProjectIssueResourceIterationEventManager", | |
| 19 | + "ProjectIssueResourceWeightEventManager", | ||
| 19 | 20 | "ProjectIssueResourceIterationEvent", | |
| 21 | + "ProjectIssueResourceWeightEvent", | ||
| 20 | 22 | "ProjectIssueResourceStateEventManager", | |
| 21 | 23 | "ProjectMergeRequestResourceLabelEvent", | |
| 22 | 24 | "ProjectMergeRequestResourceLabelEventManager", | |
@@ -135,6 +137,23 @@ def get( | |||
| 135 | 137 | ) | |
| 136 | 138 | ||
| 137 | 139 | ||
| 140 | + class ProjectIssueResourceWeightEvent(RESTObject): | ||
| 141 | + pass | ||
| 142 | + | ||
| 143 | + | ||
| 144 | + class ProjectIssueResourceWeightEventManager(RetrieveMixin, RESTManager): | ||
| 145 | + _path = "/projects/{project_id}/issues/{issue_iid}/resource_weight_events" | ||
| 146 | + _obj_cls = ProjectIssueResourceWeightEvent | ||
| 147 | + _from_parent_attrs = {"project_id": "project_id", "issue_iid": "iid"} | ||
| 148 | + | ||
| 149 | + def get( | ||
| 150 | + self, id: Union[str, int], lazy: bool = False, **kwargs: Any | ||
| 151 | + ) -> ProjectIssueResourceWeightEvent: | ||
| 152 | + return cast( | ||
| 153 | + ProjectIssueResourceWeightEvent, super().get(id=id, lazy=lazy, **kwargs) | ||
| 154 | + ) | ||
| 155 | + | ||
| 156 | + | ||
| 138 | 157 | class ProjectMergeRequestResourceLabelEvent(RESTObject): | |
| 139 | 158 | pass | |
| 140 | 159 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -27,6 +27,7 @@ | |||
| 27 | 27 | ProjectIssueResourceLabelEventManager, | |
| 28 | 28 | ProjectIssueResourceMilestoneEventManager, | |
| 29 | 29 | ProjectIssueResourceStateEventManager, | |
| 30 | + ProjectIssueResourceWeightEventManager, | ||
| 30 | 31 | ) | |
| 31 | 32 | from .notes import ProjectIssueNoteManager # noqa: F401 | |
| 32 | 33 | ||
@@ -121,6 +122,7 @@ class ProjectIssue( | |||
| 121 | 122 | resourcemilestoneevents: ProjectIssueResourceMilestoneEventManager | |
| 122 | 123 | resourcestateevents: ProjectIssueResourceStateEventManager | |
| 123 | 124 | resource_iteration_events: ProjectIssueResourceIterationEventManager | |
| 125 | + resource_weight_events: ProjectIssueResourceWeightEventManager | ||
| 124 | 126 | ||
| 125 | 127 | @cli.register_custom_action("ProjectIssue", ("to_project_id",)) | |
| 126 | 128 | @exc.on_http_error(exc.GitlabUpdateError) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -66,14 +66,25 @@ def test_issue_links(project, issue): | |||
| 66 | 66 | assert not issue.links.list() | |
| 67 | 67 | ||
| 68 | 68 | ||
| 69 | - def test_issue_events(issue): | ||
| 69 | + def test_issue_label_events(issue): | ||
| 70 | 70 | events = issue.resourcelabelevents.list() | |
| 71 | 71 | assert isinstance(events, list) | |
| 72 | 72 | ||
| 73 | 73 | event = issue.resourcelabelevents.get(events[0].id) | |
| 74 | 74 | assert isinstance(event, gitlab.v4.objects.ProjectIssueResourceLabelEvent) | |
| 75 | 75 | ||
| 76 | 76 | ||
| 77 | + def test_issue_weight_events(issue): | ||
| 78 | + issue.weight = 13 | ||
| 79 | + issue.save() | ||
| 80 | + | ||
| 81 | + events = issue.resource_weight_events.list() | ||
| 82 | + assert isinstance(events, list) | ||
| 83 | + | ||
| 84 | + event = issue.resource_weight_events.get(events[0].id) | ||
| 85 | + assert isinstance(event, gitlab.v4.objects.ProjectIssueResourceWeightEvent) | ||
| 86 | + | ||
| 87 | + | ||
| 77 | 88 | def test_issue_milestones(project, milestone): | |
| 78 | 89 | data = {"title": "my issue 1", "milestone_id": milestone.id} | |
| 79 | 90 | issue = project.issues.create(data) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments