tests: Adapt tests to return value change.

This commit is contained in:
Martin Bornhold 2016-10-27 11:43:13 +02:00
parent ef2d6c6086
commit 22dde6518a
2 changed files with 5 additions and 5 deletions

View file

@ -659,9 +659,9 @@ def update_pull_request(
commit_changes = {"added": [], "common": [], "removed": []}
if str2bool(Optional.extract(update_commits)):
if PullRequestModel().has_valid_update_type(pull_request):
_version, _commit_changes = PullRequestModel().update_commits(
update_response = PullRequestModel().update_commits(
pull_request)
commit_changes = _commit_changes or commit_changes
commit_changes = update_response.changes or commit_changes
Session().commit()
reviewers_changes = {"added": [], "removed": []}
@ -687,5 +687,5 @@ def update_pull_request(
'updated_commits': commit_changes,
'updated_reviewers': reviewers_changes
}
return data
return data

View file

@ -80,7 +80,7 @@ def test_pull_request_stays_if_update_without_change(pr_util, voted_status):
voted_status, *pull_request.reviewers)
# Update, without change
version, changes = PullRequestModel().update_commits(pull_request)
PullRequestModel().update_commits(pull_request)
# Expect that review status is the voted_status
expected_review_status = voted_status
@ -99,7 +99,7 @@ def test_pull_request_under_review_if_update(pr_util, voted_status):
# Update, with change
pr_util.update_source_repository()
version, changes = PullRequestModel().update_commits(pull_request)
PullRequestModel().update_commits(pull_request)
# Expect that review status is the voted_status
expected_review_status = db.ChangesetStatus.STATUS_UNDER_REVIEW