Chromium Code Reviews| Index: tests/git_cl_test.py |
| diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py |
| index ed1d7a56342c97873ee1091e93996e4ff25ca8e6..cc4d95385775ccf4f4526ed8d280d562e421d3e0 100755 |
| --- a/tests/git_cl_test.py |
| +++ b/tests/git_cl_test.py |
| @@ -575,7 +575,8 @@ class TestGitCl(TestCase): |
| ] |
| @staticmethod |
| - def _gerrit_upload_calls(description, reviewers, squash): |
| + def _gerrit_upload_calls(description, reviewers, squash, |
| + expected_upstream_ref='origin/refs/heads/master'): |
|
luqui
2015/04/28 23:56:24
Yes yes this is awful. My alternatives:
1. Dig i
Mike Wittman
2015/05/01 01:36:29
I went the same way attempting to get the GetTarge
|
| calls = [ |
| ((['git', 'log', '--pretty=format:%s\n\n%b', |
| 'fake_ancestor_sha..HEAD'],), |
| @@ -614,7 +615,7 @@ class TestGitCl(TestCase): |
| ref_to_push = 'HEAD' |
| calls += [ |
| - ((['git', 'rev-list', 'origin/master..' + ref_to_push],), ''), |
| + ((['git', 'rev-list', expected_upstream_ref + '..' + ref_to_push],), ''), |
| ((['git', 'config', 'rietveld.cc'],), '') |
| ] |
| receive_pack = '--receive-pack=git receive-pack ' |
| @@ -626,7 +627,8 @@ class TestGitCl(TestCase): |
| receive_pack += '' |
| calls += [ |
| ((['git', |
| - 'push', receive_pack, 'origin', ref_to_push + ':refs/for/master'],), |
| + 'push', receive_pack, 'origin', |
| + ref_to_push + ':refs/for/refs/heads/master'],), |
| '') |
| ] |
| if squash: |
| @@ -644,10 +646,13 @@ class TestGitCl(TestCase): |
| upload_args, |
| description, |
| reviewers, |
| - squash=False): |
| + squash=False, |
| + expected_upstream_ref='origin/refs/heads/master'): |
| """Generic gerrit upload test framework.""" |
| self.calls = self._gerrit_base_calls() |
| - self.calls += self._gerrit_upload_calls(description, reviewers, squash) |
| + self.calls += self._gerrit_upload_calls( |
| + description, reviewers, squash, |
| + expected_upstream_ref=expected_upstream_ref) |
| git_cl.main(['upload'] + upload_args) |
| def test_gerrit_upload_without_change_id(self): |
| @@ -680,7 +685,8 @@ class TestGitCl(TestCase): |
| ['--squash'], |
| 'desc\n\nBUG=\nChange-Id:123456789\n', |
| [], |
| - squash=True) |
| + squash=True, |
| + expected_upstream_ref='origin/master') |
| def test_config_gerrit_download_hook(self): |
| self.mock(git_cl, 'FindCodereviewSettingsFile', CodereviewSettingsFileMock) |