Commit 73827d15 authored by Andrii Shyshkalov's avatar Andrii Shyshkalov Committed by Commit Bot

Refactor git cl tests.

R=machenbach@chromium.org

Change-Id: I54f4a0507352f4d4e460188c9bc6425ff83f28bb
Reviewed-on: https://chromium-review.googlesource.com/475910Reviewed-by: 's avatarMichael Achenbach <machenbach@chromium.org>
Commit-Queue: Andrii Shyshkalov <tandrii@chromium.org>
parent 413b9ccf
......@@ -700,16 +700,17 @@ class TestGitCl(TestCase):
@classmethod
def _upload_calls(cls, similarity, find_copies, private):
return (cls._git_base_calls(similarity, find_copies) +
return (cls._rietveld_git_base_calls(similarity, find_copies) +
cls._git_upload_calls(private))
@classmethod
def _upload_no_rev_calls(cls, similarity, find_copies):
return (cls._git_base_calls(similarity, find_copies) +
cls._git_upload_no_rev_calls())
def _rietveld_upload_no_rev_calls(cls, similarity, find_copies):
return (cls._rietveld_git_base_calls(similarity, find_copies) + [
((['git', 'config', 'core.editor'],), ''),
])
@classmethod
def _git_base_calls(cls, similarity, find_copies):
def _rietveld_git_base_calls(cls, similarity, find_copies):
if similarity is None:
similarity = '50'
similarity_call = ((['git', 'config',
......@@ -768,12 +769,6 @@ class TestGitCl(TestCase):
((['git', 'config', 'rietveld.bug-prefix'],), ''),
]
@classmethod
def _git_upload_no_rev_calls(cls):
return [
((['git', 'config', 'core.editor'],), ''),
]
@classmethod
def _git_upload_calls(cls, private):
if private:
......@@ -976,7 +971,7 @@ class TestGitCl(TestCase):
def test_reviewer_send_mail_no_rev(self):
# Fails without a reviewer.
stdout = StringIO.StringIO()
self.calls = self._upload_no_rev_calls(None, None) + [
self.calls = self._rietveld_upload_no_rev_calls(None, None) + [
((['DieWithError', 'Must specify reviewers to send email.'],),
SystemExitMock())
]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment