| 1 |
"""Fixtures.""" |
| 2 |
# pylint: disable=missing-docstring |
| 3 |
import pytest |
| 4 |
|
| 5 |
ISSUE = { |
| 6 |
"id": 1, |
| 7 |
"node_id": "MDU6SXNzdWUx", |
| 8 |
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1347", |
| 9 |
"repository_url": "https://api.github.com/repos/octocat/Hello-World", |
| 10 |
"labels_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}", |
| 11 |
"comments_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments", |
| 12 |
"events_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/events", |
| 13 |
"html_url": "https://github.com/octocat/Hello-World/issues/1347", |
| 14 |
"number": 1347, |
| 15 |
"state": "open", |
| 16 |
"title": "Found a bug", |
| 17 |
"body": "I'm having a problem with this.", |
| 18 |
"user": { |
| 19 |
"login": "octocat", |
| 20 |
"id": 1, |
| 21 |
"node_id": "MDQ6VXNlcjE=", |
| 22 |
"avatar_url": "https://github.com/images/error/octocat_happy.gif", |
| 23 |
"gravatar_id": "", |
| 24 |
"url": "https://api.github.com/users/octocat", |
| 25 |
"html_url": "https://github.com/octocat", |
| 26 |
"followers_url": "https://api.github.com/users/octocat/followers", |
| 27 |
"following_url": "https://api.github.com/users/octocat/following{/other_user}", |
| 28 |
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", |
| 29 |
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", |
| 30 |
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions", |
| 31 |
"organizations_url": "https://api.github.com/users/octocat/orgs", |
| 32 |
"repos_url": "https://api.github.com/users/octocat/repos", |
| 33 |
"events_url": "https://api.github.com/users/octocat/events{/privacy}", |
| 34 |
"received_events_url": "https://api.github.com/users/octocat/received_events", |
| 35 |
"type": "User", |
| 36 |
"site_admin": False, |
| 37 |
}, |
| 38 |
"labels": [ |
| 39 |
{ |
| 40 |
"id": 208045946, |
| 41 |
"node_id": "MDU6TGFiZWwyMDgwNDU5NDY=", |
| 42 |
"url": "https://api.github.com/repos/octocat/Hello-World/labels/bug", |
| 43 |
"name": "bug", |
| 44 |
"description": "Something isn't working", |
| 45 |
"color": "f29513", |
| 46 |
"default": True, |
| 47 |
} |
| 48 |
], |
| 49 |
"assignee": { |
| 50 |
"login": "octocat", |
| 51 |
"id": 1, |
| 52 |
"node_id": "MDQ6VXNlcjE=", |
| 53 |
"avatar_url": "https://github.com/images/error/octocat_happy.gif", |
| 54 |
"gravatar_id": "", |
| 55 |
"url": "https://api.github.com/users/octocat", |
| 56 |
"html_url": "https://github.com/octocat", |
| 57 |
"followers_url": "https://api.github.com/users/octocat/followers", |
| 58 |
"following_url": "https://api.github.com/users/octocat/following{/other_user}", |
| 59 |
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", |
| 60 |
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", |
| 61 |
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions", |
| 62 |
"organizations_url": "https://api.github.com/users/octocat/orgs", |
| 63 |
"repos_url": "https://api.github.com/users/octocat/repos", |
| 64 |
"events_url": "https://api.github.com/users/octocat/events{/privacy}", |
| 65 |
"received_events_url": "https://api.github.com/users/octocat/received_events", |
| 66 |
"type": "User", |
| 67 |
"site_admin": False, |
| 68 |
}, |
| 69 |
"assignees": [ |
| 70 |
{ |
| 71 |
"login": "octocat", |
| 72 |
"id": 1, |
| 73 |
"node_id": "MDQ6VXNlcjE=", |
| 74 |
"avatar_url": "https://github.com/images/error/octocat_happy.gif", |
| 75 |
"gravatar_id": "", |
| 76 |
"url": "https://api.github.com/users/octocat", |
| 77 |
"html_url": "https://github.com/octocat", |
| 78 |
"followers_url": "https://api.github.com/users/octocat/followers", |
| 79 |
"following_url": "https://api.github.com/users/octocat/following{/other_user}", |
| 80 |
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", |
| 81 |
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", |
| 82 |
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions", |
| 83 |
"organizations_url": "https://api.github.com/users/octocat/orgs", |
| 84 |
"repos_url": "https://api.github.com/users/octocat/repos", |
| 85 |
"events_url": "https://api.github.com/users/octocat/events{/privacy}", |
| 86 |
"received_events_url": "https://api.github.com/users/octocat/received_events", |
| 87 |
"type": "User", |
| 88 |
"site_admin": False, |
| 89 |
} |
| 90 |
], |
| 91 |
"milestone": { |
| 92 |
"url": "https://api.github.com/repos/octocat/Hello-World/milestones/1", |
| 93 |
"html_url": "https://github.com/octocat/Hello-World/milestones/v1.0", |
| 94 |
"labels_url": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels", |
| 95 |
"id": 1002604, |
| 96 |
"node_id": "MDk6TWlsZXN0b25lMTAwMjYwNA==", |
| 97 |
"number": 1, |
| 98 |
"state": "open", |
| 99 |
"title": "v1.0", |
| 100 |
"description": "Tracking milestone for version 1.0", |
| 101 |
"creator": { |
| 102 |
"login": "octocat", |
| 103 |
"id": 1, |
| 104 |
"node_id": "MDQ6VXNlcjE=", |
| 105 |
"avatar_url": "https://github.com/images/error/octocat_happy.gif", |
| 106 |
"gravatar_id": "", |
| 107 |
"url": "https://api.github.com/users/octocat", |
| 108 |
"html_url": "https://github.com/octocat", |
| 109 |
"followers_url": "https://api.github.com/users/octocat/followers", |
| 110 |
"following_url": "https://api.github.com/users/octocat/following{/other_user}", |
| 111 |
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", |
| 112 |
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", |
| 113 |
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions", |
| 114 |
"organizations_url": "https://api.github.com/users/octocat/orgs", |
| 115 |
"repos_url": "https://api.github.com/users/octocat/repos", |
| 116 |
"events_url": "https://api.github.com/users/octocat/events{/privacy}", |
| 117 |
"received_events_url": "https://api.github.com/users/octocat/received_events", |
| 118 |
"type": "User", |
| 119 |
"site_admin": False, |
| 120 |
}, |
| 121 |
"open_issues": 4, |
| 122 |
"closed_issues": 8, |
| 123 |
"created_at": "2011-04-10T20:09:31Z", |
| 124 |
"updated_at": "2014-03-03T18:58:10Z", |
| 125 |
"closed_at": "2013-02-12T13:22:01Z", |
| 126 |
"due_on": "2012-10-09T23:39:01Z", |
| 127 |
}, |
| 128 |
"locked": True, |
| 129 |
"active_lock_reason": "too heated", |
| 130 |
"comments": 0, |
| 131 |
"pull_request": { |
| 132 |
"url": "https://api.github.com/repos/octocat/Hello-World/pulls/1347", |
| 133 |
"html_url": "https://github.com/octocat/Hello-World/pull/1347", |
| 134 |
"diff_url": "https://github.com/octocat/Hello-World/pull/1347.diff", |
| 135 |
"patch_url": "https://github.com/octocat/Hello-World/pull/1347.patch", |
| 136 |
}, |
| 137 |
"closed_at": None, |
| 138 |
"created_at": "2011-04-22T13:33:48Z", |
| 139 |
"updated_at": "2011-04-22T13:33:48Z", |
| 140 |
"closed_by": { |
| 141 |
"login": "octocat", |
| 142 |
"id": 1, |
| 143 |
"node_id": "MDQ6VXNlcjE=", |
| 144 |
"avatar_url": "https://github.com/images/error/octocat_happy.gif", |
| 145 |
"gravatar_id": "", |
| 146 |
"url": "https://api.github.com/users/octocat", |
| 147 |
"html_url": "https://github.com/octocat", |
| 148 |
"followers_url": "https://api.github.com/users/octocat/followers", |
| 149 |
"following_url": "https://api.github.com/users/octocat/following{/other_user}", |
| 150 |
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}", |
| 151 |
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}", |
| 152 |
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions", |
| 153 |
"organizations_url": "https://api.github.com/users/octocat/orgs", |
| 154 |
"repos_url": "https://api.github.com/users/octocat/repos", |
| 155 |
"events_url": "https://api.github.com/users/octocat/events{/privacy}", |
| 156 |
"received_events_url": "https://api.github.com/users/octocat/received_events", |
| 157 |
"type": "User", |
| 158 |
"site_admin": False, |
| 159 |
}, |
| 160 |
} |
| 161 |
|
| 162 |
|
| 163 |
@pytest.fixture() |
| 164 |
def issue_response(): |
| 165 |
return ISSUE |
| 166 |
|
| 167 |
|
| 168 |
@pytest.fixture() |
| 169 |
def issues_response(): |
| 170 |
return [ISSUE] |