##// 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 assert self.target_ref.commit_id in commit_ids
320 assert self.target_ref.commit_id in commit_ids
321
321
322 merge_commit = target_commits[-1]
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 assert merge_commit.message.strip() == 'merge message 1'
324 assert merge_commit.message.strip() == 'merge message 1'
325 assert merge_commit.author == 'test user <test@rhodecode.com>'
325 assert merge_commit.author == 'test user <test@rhodecode.com>'
326
326
@@ -347,19 +347,21 b' class TestRepositoryMerge:'
347
347
348 def test_merge_success_dry_run(self, vcsbackend):
348 def test_merge_success_dry_run(self, vcsbackend):
349 self.prepare_for_success(vcsbackend)
349 self.prepare_for_success(vcsbackend)
350 expected_merge_response = MergeResponse(
351 True, False, None, MergeFailureReason.NONE)
352
350
353 merge_response = self.target_repo.merge(
351 merge_response = self.target_repo.merge(
354 self.target_ref, self.source_repo, self.source_ref, self.workspace,
352 self.target_ref, self.source_repo, self.source_ref, self.workspace,
355 dry_run=True)
353 dry_run=True)
356 assert merge_response == expected_merge_response
357
354
358 # We call it twice so to make sure we can handle updates
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 self.target_ref, self.source_repo, self.source_ref, self.workspace,
357 self.target_ref, self.source_repo, self.source_ref, self.workspace,
361 dry_run=True)
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 @pytest.mark.parametrize('dry_run', [True, False])
366 @pytest.mark.parametrize('dry_run', [True, False])
365 def test_merge_conflict(self, vcsbackend, dry_run):
367 def test_merge_conflict(self, vcsbackend, dry_run):
General Comments 0
You need to be logged in to leave comments. Login now