Skip to content

Commit fae7c8b

Browse files
committed
Merge pull request sigmavirus24#574 from adrianmoisey/is_locked_v2
Add locked to issue
2 parents 1696025 + ce2c253 commit fae7c8b

File tree

2 files changed

+18
-6
lines changed

2 files changed

+18
-6
lines changed

github3/issues/issue.py

+2
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,8 @@ def _update_attributes(self, issue):
6969
labels_url = issue.get('labels_url')
7070
#: Labels URL Template. Expand with ``name``
7171
self.labels_urlt = URITemplate(labels_url) if labels_url else None
72+
#: Locked status
73+
self.locked = issue.get('locked')
7274
#: :class:`Milestone <github3.issues.milestone.Milestone>` this
7375
#: issue was assigned to.
7476
self.milestone = None

tests/unit/json/issue_example

+16-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
{
2+
"id": 1,
23
"url": "https://api.github.com/repos/octocat/Hello-World/issues/1347",
4+
"repository_url": "https://api.github.com/repos/octocat/Hello-World",
5+
"labels_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/labels{/name}",
6+
"comments_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/comments",
7+
"events_url": "https://api.github.com/repos/octocat/Hello-World/issues/1347/events",
38
"html_url": "https://github.com/octocat/Hello-World/issues/1347",
49
"number": 1347,
510
"state": "open",
@@ -9,7 +14,7 @@
914
"login": "octocat",
1015
"id": 1,
1116
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
12-
"gravatar_id": "somehexcode",
17+
"gravatar_id": "",
1318
"url": "https://api.github.com/users/octocat",
1419
"html_url": "https://github.com/octocat",
1520
"followers_url": "https://api.github.com/users/octocat/followers",
@@ -35,7 +40,7 @@
3540
"login": "octocat",
3641
"id": 1,
3742
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
38-
"gravatar_id": "somehexcode",
43+
"gravatar_id": "",
3944
"url": "https://api.github.com/users/octocat",
4045
"html_url": "https://github.com/octocat",
4146
"followers_url": "https://api.github.com/users/octocat/followers",
@@ -52,15 +57,18 @@
5257
},
5358
"milestone": {
5459
"url": "https://api.github.com/repos/octocat/Hello-World/milestones/1",
60+
"html_url": "https://github.com/octocat/Hello-World/milestones/v1.0",
61+
"labels_url": "https://api.github.com/repos/octocat/Hello-World/milestones/1/labels",
62+
"id": 1002604,
5563
"number": 1,
5664
"state": "open",
5765
"title": "v1.0",
58-
"description": "",
66+
"description": "Tracking milestone for version 1.0",
5967
"creator": {
6068
"login": "octocat",
6169
"id": 1,
6270
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
63-
"gravatar_id": "somehexcode",
71+
"gravatar_id": "",
6472
"url": "https://api.github.com/users/octocat",
6573
"html_url": "https://github.com/octocat",
6674
"followers_url": "https://api.github.com/users/octocat/followers",
@@ -79,8 +87,10 @@
7987
"closed_issues": 8,
8088
"created_at": "2011-04-10T20:09:31Z",
8189
"updated_at": "2014-03-03T18:58:10Z",
82-
"due_on": null
90+
"closed_at": "2013-02-12T13:22:01Z",
91+
"due_on": "2012-10-09T23:39:01Z"
8392
},
93+
"locked": false,
8494
"comments": 0,
8595
"pull_request": {
8696
"url": "https://api.github.com/repos/octocat/Hello-World/pulls/1347",
@@ -95,7 +105,7 @@
95105
"login": "octocat",
96106
"id": 1,
97107
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
98-
"gravatar_id": "somehexcode",
108+
"gravatar_id": "",
99109
"url": "https://api.github.com/users/octocat",
100110
"html_url": "https://github.com/octocat",
101111
"followers_url": "https://api.github.com/users/octocat/followers",

0 commit comments

Comments
 (0)