mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[FIX] runbot_merge: review action is APPROVE
Despite the review *state* being APPROVE*D*. Fix test & handling in mock github.
This commit is contained in:
parent
3de8262b50
commit
50b9943d78
@ -575,16 +575,16 @@ class Client(werkzeug.test.Client):
|
|||||||
|
|
||||||
def pull_request_review(self, action, pr, user, body):
|
def pull_request_review(self, action, pr, user, body):
|
||||||
"""
|
"""
|
||||||
:type action: 'APPROVED' | 'REQUEST_CHANGES' | 'COMMENT'
|
:type action: 'APPROVE' | 'REQUEST_CHANGES' | 'COMMENT'
|
||||||
:type pr: PR
|
:type pr: PR
|
||||||
:type user: str
|
:type user: str
|
||||||
:type body: str
|
:type body: str
|
||||||
"""
|
"""
|
||||||
assert action in ('APPROVED', 'REQUEST_CHANGES', 'COMMENT')
|
assert action in ('APPROVE', 'REQUEST_CHANGES', 'COMMENT')
|
||||||
return self.open(self._make_env(
|
return self.open(self._make_env(
|
||||||
'pull_request_review', {
|
'pull_request_review', {
|
||||||
'review': {
|
'review': {
|
||||||
'state': action,
|
'state': 'APPROVED' if action == 'APPROVE' else action,
|
||||||
'body': body,
|
'body': body,
|
||||||
'user': {'login': user},
|
'user': {'login': user},
|
||||||
},
|
},
|
||||||
|
@ -1153,6 +1153,6 @@ class TestReviewing(object):
|
|||||||
assert pr.priority == 1
|
assert pr.priority == 1
|
||||||
assert pr.state == 'opened'
|
assert pr.state == 'opened'
|
||||||
|
|
||||||
prx.post_review('APPROVED', 'reviewer', "hansen priority=2")
|
prx.post_review('APPROVE', 'reviewer', "hansen priority=2")
|
||||||
assert pr.priority == 2
|
assert pr.priority == 2
|
||||||
assert pr.state == 'approved'
|
assert pr.state == 'approved'
|
||||||
|
Loading…
Reference in New Issue
Block a user