Skip to content

Commit 135a994

Browse files
committed
Fix ReviewComment.reply test
1 parent d56c32f commit 135a994

File tree

2 files changed

+49
-42
lines changed

2 files changed

+49
-42
lines changed
Lines changed: 43 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,48 @@
11
{
2-
"url": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1",
2+
"url": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1",
3+
"id": 10,
4+
"pull_request_review_id": 42,
5+
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
6+
"path": "file1.txt",
7+
"position": 1,
8+
"original_position": 4,
9+
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
10+
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
11+
"in_reply_to_id": 8,
12+
"user": {
13+
"login": "octocat",
314
"id": 1,
4-
"diff_hunk": "@@ -16,33 +16,40 @@ public class Connection : IConnection...",
5-
"path": "file1.txt",
6-
"position": 1,
7-
"original_position": 4,
8-
"commit_id": "6dcb09b5b57875f334f61aebed695e2e4193db5e",
9-
"original_commit_id": "9c48853fa3dc5c1c3d6f1f1cd1f2743e72652840",
10-
"user": {
11-
"login": "octocat",
12-
"id": 1,
13-
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
14-
"gravatar_id": "",
15-
"url": "https://api.github.com/users/octocat",
16-
"html_url": "https://github.com/octocat",
17-
"followers_url": "https://api.github.com/users/octocat/followers",
18-
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
19-
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
20-
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
21-
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
22-
"organizations_url": "https://api.github.com/users/octocat/orgs",
23-
"repos_url": "https://api.github.com/users/octocat/repos",
24-
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
25-
"received_events_url": "https://api.github.com/users/octocat/received_events",
26-
"type": "User",
27-
"site_admin": false
15+
"avatar_url": "https://github.com/images/error/octocat_happy.gif",
16+
"gravatar_id": "",
17+
"url": "https://api.github.com/users/octocat",
18+
"html_url": "https://github.com/octocat",
19+
"followers_url": "https://api.github.com/users/octocat/followers",
20+
"following_url": "https://api.github.com/users/octocat/following{/other_user}",
21+
"gists_url": "https://api.github.com/users/octocat/gists{/gist_id}",
22+
"starred_url": "https://api.github.com/users/octocat/starred{/owner}{/repo}",
23+
"subscriptions_url": "https://api.github.com/users/octocat/subscriptions",
24+
"organizations_url": "https://api.github.com/users/octocat/orgs",
25+
"repos_url": "https://api.github.com/users/octocat/repos",
26+
"events_url": "https://api.github.com/users/octocat/events{/privacy}",
27+
"received_events_url": "https://api.github.com/users/octocat/received_events",
28+
"type": "User",
29+
"site_admin": false
30+
},
31+
"body": "Great stuff",
32+
"created_at": "2011-04-14T16:00:49Z",
33+
"updated_at": "2011-04-14T16:00:49Z",
34+
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
35+
"pull_request_url": "https://api.github.com/repos/octocat/Hello-World/pulls/1",
36+
"_links": {
37+
"self": {
38+
"href": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1"
2839
},
29-
"body": "Great stuff",
30-
"created_at": "2011-04-14T16:00:49Z",
31-
"updated_at": "2011-04-14T16:00:49Z",
32-
"html_url": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1",
33-
"pull_request_url": "https://api.github.com/repos/octocat/Hello-World/pulls/1",
34-
"_links": {
35-
"self": {
36-
"href": "https://api.github.com/repos/octocat/Hello-World/pulls/comments/1"
37-
},
38-
"html": {
39-
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
40-
},
41-
"pull_request": {
42-
"href": "https://api.github.com/repos/octocat/Hello-World/pulls/1"
43-
}
40+
"html": {
41+
"href": "https://github.com/octocat/Hello-World/pull/1#discussion-diff-1"
42+
},
43+
"pull_request": {
44+
"href": "https://api.github.com/repos/octocat/Hello-World/pulls/1"
4445
}
46+
}
4547
}
48+

tests/unit/test_pulls.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
'https://api.github.com/repos/octocat/Hello-World/pulls/1347'
1616
)
1717

18+
review_comment_url_for = helper.create_url_helper(
19+
'https://api.github.com/repos/octocat/Hello-World/pulls/1/comments'
20+
)
21+
1822

1923
class TestPullRequest(helper.UnitHelper):
2024
"""PullRequest unit tests."""
@@ -254,8 +258,8 @@ def test_reply(self):
254258
self.instance.reply('foo')
255259

256260
self.post_called_with(
257-
url_for('comments'),
258-
data={'body': 'foo', 'in_reply_to': '1'}
261+
review_comment_url_for(),
262+
data={'body': 'foo', 'in_reply_to': 1}
259263
)
260264

261265
def test_reply_requires_authentication(self):

0 commit comments

Comments
 (0)