From 50b9943d7807c83c97839fc1ec580f5ad94b8268 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 8 Jun 2018 20:38:23 +0200 Subject: [PATCH] [FIX] runbot_merge: review action is APPROVE Despite the review *state* being APPROVE*D*. Fix test & handling in mock github. --- runbot_merge/tests/fake_github/__init__.py | 6 +++--- runbot_merge/tests/test_basic.py | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runbot_merge/tests/fake_github/__init__.py b/runbot_merge/tests/fake_github/__init__.py index 5ff1b331..fa78a1b6 100644 --- a/runbot_merge/tests/fake_github/__init__.py +++ b/runbot_merge/tests/fake_github/__init__.py @@ -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}, }, diff --git a/runbot_merge/tests/test_basic.py b/runbot_merge/tests/test_basic.py index 98d039f6..4e1a99b9 100644 --- a/runbot_merge/tests/test_basic.py +++ b/runbot_merge/tests/test_basic.py @@ -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'