[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:
Xavier Morel 2018-06-08 20:38:23 +02:00 committed by xmo-odoo
parent 3de8262b50
commit 50b9943d78
2 changed files with 4 additions and 4 deletions

View File

@ -575,16 +575,16 @@ class Client(werkzeug.test.Client):
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 user: str
:type body: str
"""
assert action in ('APPROVED', 'REQUEST_CHANGES', 'COMMENT')
assert action in ('APPROVE', 'REQUEST_CHANGES', 'COMMENT')
return self.open(self._make_env(
'pull_request_review', {
'review': {
'state': action,
'state': 'APPROVED' if action == 'APPROVE' else action,
'body': body,
'user': {'login': user},
},

View File

@ -1153,6 +1153,6 @@ class TestReviewing(object):
assert pr.priority == 1
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.state == 'approved'