def test_empty_octopus_merge(self): mock_repo = MagicMock(spec=Repo) api = LocalGitAPI(mock_repo) sha = api.octopus_merge('public/release-candidate', []) mock_repo.git.merge.assert_not_called() self.assertEqual(sha, mock_repo.head.commit.hexsha)
def test_octopus_merge(self): mock_repo = MagicMock(spec=Repo) api = LocalGitAPI(mock_repo) sha = api.octopus_merge('public/release-candidate', ['12345abcdef', 'deadbeef']) mock_repo.git.merge.assert_called_once_with('12345abcdef', 'deadbeef') self.assertEqual(sha, mock_repo.head.commit.hexsha)