# HG changeset patch # User Martin Bornhold # Date 2016-10-23 14:04:07 # Node ID a4bf20df2db6e6e044910e16a4d859cea16a42c7 # Parent fd5a3923017fcc5b2476315a331a8bb6736e71d3 tests: Adapt tests to new merge response object. diff --git a/rhodecode/tests/vcs/test_hg.py b/rhodecode/tests/vcs/test_hg.py --- a/rhodecode/tests/vcs/test_hg.py +++ b/rhodecode/tests/vcs/test_hg.py @@ -599,7 +599,7 @@ TODO: To be written... 'test user', 'test@rhodecode.com', 'merge message 1', dry_run=False) expected_merge_response = MergeResponse( - True, True, merge_response.merge_commit_id, + True, True, merge_response.merge_ref, MergeFailureReason.NONE) assert merge_response == expected_merge_response @@ -611,14 +611,14 @@ TODO: To be written... assert target_ref.commit_id in commit_ids merge_commit = target_commits[-1] - assert merge_commit.raw_id == merge_response.merge_commit_id + assert merge_commit.raw_id == merge_response.merge_ref.commit_id assert merge_commit.message.strip() == 'merge message 1' assert merge_commit.author == 'test user ' # Check the bookmark was updated in the target repo assert ( target_repo.bookmarks[bookmark_name] == - merge_response.merge_commit_id) + merge_response.merge_ref.commit_id) def test_merge_source_is_bookmark(self, vcsbackend_hg): target_repo = vcsbackend_hg.create_repo(number_of_commits=1) @@ -643,7 +643,7 @@ TODO: To be written... 'test user', 'test@rhodecode.com', 'merge message 1', dry_run=False) expected_merge_response = MergeResponse( - True, True, merge_response.merge_commit_id, + True, True, merge_response.merge_ref, MergeFailureReason.NONE) assert merge_response == expected_merge_response @@ -717,7 +717,7 @@ TODO: To be written... dry_run=False, use_rebase=True) expected_merge_response = MergeResponse( - True, True, merge_response.merge_commit_id, + True, True, merge_response.merge_ref, MergeFailureReason.NONE) assert merge_response == expected_merge_response diff --git a/rhodecode/tests/vcs/test_repository.py b/rhodecode/tests/vcs/test_repository.py --- a/rhodecode/tests/vcs/test_repository.py +++ b/rhodecode/tests/vcs/test_repository.py @@ -308,7 +308,7 @@ class TestRepositoryMerge: 'test user', 'test@rhodecode.com', 'merge message 1', dry_run=False) expected_merge_response = MergeResponse( - True, True, merge_response.merge_commit_id, + True, True, merge_response.merge_ref, MergeFailureReason.NONE) assert merge_response == expected_merge_response @@ -320,27 +320,28 @@ class TestRepositoryMerge: assert self.target_ref.commit_id in commit_ids merge_commit = target_commits[-1] - assert merge_commit.raw_id == merge_response.merge_commit_id + assert merge_commit.raw_id == merge_response.merge_ref assert merge_commit.message.strip() == 'merge message 1' assert merge_commit.author == 'test user ' # We call it twice so to make sure we can handle updates target_ref = Reference( self.target_ref.type, self.target_ref.name, - merge_response.merge_commit_id) + merge_response.merge_ref.commit_id) merge_response = target_repo.merge( target_ref, self.source_repo, self.source_ref, self.workspace, 'test user', 'test@rhodecode.com', 'merge message 2', dry_run=False) expected_merge_response = MergeResponse( - True, True, merge_response.merge_commit_id, + True, True, merge_response.merge_ref, MergeFailureReason.NONE) assert merge_response == expected_merge_response target_repo = backends.get_backend( vcsbackend.alias)(self.target_repo.path) - merge_commit = target_repo.get_commit(merge_response.merge_commit_id) + merge_commit = target_repo.get_commit( + merge_response.merge_ref.commit_id) assert merge_commit.message.strip() == 'merge message 1' assert merge_commit.author == 'test user '