Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(issues): add missing get verb to IssueManager#1223

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
max-wittig merged 1 commit intomasterfromfeat/single-issue-api
Feb 6, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletionsgitlab/tests/objects/test_issues.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@


@pytest.fixture
defresp_issue():
defresp_list_issues():
content = [{"name": "name", "id": 1}, {"name": "other_name", "id": 2}]

with responses.RequestsMock() as rsps:
Expand All@@ -23,6 +23,19 @@ def resp_issue():
yield rsps


@pytest.fixture
def resp_get_issue():
with responses.RequestsMock() as rsps:
rsps.add(
method=responses.GET,
url="http://localhost/api/v4/issues/1",
json={"name": "name", "id": 1},
content_type="application/json",
status=200,
)
yield rsps


@pytest.fixture
def resp_issue_statistics():
content = {"statistics": {"counts": {"all": 20, "closed": 5, "opened": 15}}}
Expand All@@ -38,12 +51,18 @@ def resp_issue_statistics():
yield rsps


deftest_issues(gl,resp_issue):
deftest_list_issues(gl,resp_list_issues):
data = gl.issues.list()
assert data[1].id == 2
assert data[1].name == "other_name"


def test_get_issue(gl, resp_get_issue):
issue = gl.issues.get(1)
assert issue.id == 1
assert issue.name == "name"


def test_project_issues_statistics(project, resp_issue_statistics):
statistics = project.issuesstatistics.get()
assert isinstance(statistics, ProjectIssuesStatistics)
Expand Down
2 changes: 1 addition & 1 deletiongitlab/v4/objects/__init__.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1641,7 +1641,7 @@ class Issue(RESTObject):
_short_print_attr = "title"


class IssueManager(ListMixin, RESTManager):
class IssueManager(RetrieveMixin, RESTManager):
_path = "/issues"
_obj_cls = Issue
_list_filters = (
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp