##// END OF EJS Templates
tests: Adapt asserts to work with merge reference onbject in merge response.
Martin Bornhold -
r1059:eda82a60 default
parent child Browse files
Show More
@@ -320,7 +320,7 b' class TestRepositoryMerge:'
320 320 assert self.target_ref.commit_id in commit_ids
321 321
322 322 merge_commit = target_commits[-1]
323 assert merge_commit.raw_id == merge_response.merge_ref
323 assert merge_commit.raw_id == merge_response.merge_ref.commit_id
324 324 assert merge_commit.message.strip() == 'merge message 1'
325 325 assert merge_commit.author == 'test user <test@rhodecode.com>'
326 326
@@ -347,19 +347,21 b' class TestRepositoryMerge:'
347 347
348 348 def test_merge_success_dry_run(self, vcsbackend):
349 349 self.prepare_for_success(vcsbackend)
350 expected_merge_response = MergeResponse(
351 True, False, None, MergeFailureReason.NONE)
352 350
353 351 merge_response = self.target_repo.merge(
354 352 self.target_ref, self.source_repo, self.source_ref, self.workspace,
355 353 dry_run=True)
356 assert merge_response == expected_merge_response
357 354
358 355 # We call it twice so to make sure we can handle updates
359 merge_response = self.target_repo.merge(
356 merge_response_update = self.target_repo.merge(
360 357 self.target_ref, self.source_repo, self.source_ref, self.workspace,
361 358 dry_run=True)
362 assert merge_response == expected_merge_response
359
360 assert merge_response == merge_response_update
361 assert merge_response.possible is True
362 assert merge_response.executed is False
363 assert merge_response.merge_ref
364 assert merge_response.failure_reason is MergeFailureReason.NONE
363 365
364 366 @pytest.mark.parametrize('dry_run', [True, False])
365 367 def test_merge_conflict(self, vcsbackend, dry_run):
General Comments 0
You need to be logged in to leave comments. Login now