mirror of
https://github.com/status-im/PyGithub.git
synced 2026-08-31 10:51:14 +00:00
Fix assertion for subject_type in creating pull request review comment (#2642)
Co-authored-by: Enrico Minack <github@enrico.minack.dev>
This commit is contained in:
co-authored by
Enrico Minack
parent
ff0f31c276
commit
4933459e6b
@@ -448,8 +448,8 @@ class PullRequest(github.GithubObject.CompletableGithubObject):
|
||||
], start_side
|
||||
assert in_reply_to is github.GithubObject.NotSet or isinstance(in_reply_to, int), in_reply_to
|
||||
assert subject_type is github.GithubObject.NotSet or subject_type in [
|
||||
"LINE",
|
||||
"FILE",
|
||||
"line",
|
||||
"file",
|
||||
"side",
|
||||
], subject_type
|
||||
assert isinstance(as_suggestion, bool), as_suggestion
|
||||
|
||||
@@ -166,7 +166,7 @@ class PullRequest(Framework.TestCase):
|
||||
commit,
|
||||
"src/github/Issue.py",
|
||||
5,
|
||||
subject_type="FILE",
|
||||
subject_type="file",
|
||||
)
|
||||
self.assertEqual(comment.id, 886298)
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ api.github.com
|
||||
None
|
||||
/repos/PyGithub/PyGithub/pulls/31/comments
|
||||
{'Content-Type': 'application/json', 'Authorization': 'Basic login_and_password_removed', 'User-Agent': 'PyGithub/Python'}
|
||||
{"body": "Comment created by PyGithub", "commit_id": "8a4f306d4b223682dd19410d4a9150636ebe4206", "line": 5, "path": "src/github/Issue.py", "subject_type": "FILE"}
|
||||
{"body": "Comment created by PyGithub", "commit_id": "8a4f306d4b223682dd19410d4a9150636ebe4206", "line": 5, "path": "src/github/Issue.py", "subject_type": "file"}
|
||||
201
|
||||
[('status', '201 Created'), ('x-ratelimit-remaining', '4953'), ('content-length', '937'), ('server', 'nginx/1.0.13'), ('connection', 'keep-alive'), ('x-ratelimit-limit', '5000'), ('etag', '"7ca841d45253326d61bee20c809872dc"'), ('date', 'Sun, 27 May 2012 09:40:12 GMT'), ('content-type', 'application/json; charset=utf-8'), ('location', 'https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298')]
|
||||
{"updated_at":"2012-05-27T09:40:12Z","line":5,"original_position":5,"body":"Comment created by PyGithub","url":"https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298","commit_id":"8a4f306d4b223682dd19410d4a9150636ebe4206","created_at":"2012-05-27T09:40:12Z","user":{"url":"https://api.github.com/users/jacquev6","avatar_url":"https://secure.gravatar.com/avatar/b68de5ae38616c296fa345d2b9df2225?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"b68de5ae38616c296fa345d2b9df2225","login":"jacquev6","id":327146},"original_commit_id":"8a4f306d4b223682dd19410d4a9150636ebe4206","path":"src/github/Issue.py","id":886298,"_links":{"self":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/comments/886298"},"html":{"href":"https://github.com/jacquev6/PyGithub/pull/31#r886298"},"pull_request":{"href":"https://api.github.com/repos/jacquev6/PyGithub/pulls/31"}}}
|
||||
|
||||
Reference in New Issue
Block a user