summaryrefslogtreecommitdiff
path: root/gitlab/tests
diff options
context:
space:
mode:
Diffstat (limited to 'gitlab/tests')
-rw-r--r--gitlab/tests/objects/test_issues.py23
1 files changed, 21 insertions, 2 deletions
diff --git a/gitlab/tests/objects/test_issues.py b/gitlab/tests/objects/test_issues.py
index f67d720..93d8e0c 100644
--- a/gitlab/tests/objects/test_issues.py
+++ b/gitlab/tests/objects/test_issues.py
@@ -9,7 +9,7 @@ from gitlab.v4.objects import ProjectIssuesStatistics
@pytest.fixture
-def resp_issue():
+def resp_list_issues():
content = [{"name": "name", "id": 1}, {"name": "other_name", "id": 2}]
with responses.RequestsMock() as rsps:
@@ -24,6 +24,19 @@ def resp_issue():
@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}}}
@@ -38,12 +51,18 @@ def resp_issue_statistics():
yield rsps
-def test_issues(gl, resp_issue):
+def test_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)