Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1192)

Unified Diff: tests/git_cl_test.py

Issue 14854003: Make git-cl more accurately imitate git's editor selection process, and respect $VISUAL. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: Make tests use $GIT_EDITOR instead of $EDITOR (previously they failed for me, as $EDITOR was overriā€¦ Created 7 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/basic.sh ('k') | tests/owners.sh » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_cl_test.py
diff --git a/tests/git_cl_test.py b/tests/git_cl_test.py
index 73d95957f04ad33e20b511f9e08ae1b251d6ead2..bb907f2ccb203e8152f61f134c33e2b43f285a16 100755
--- a/tests/git_cl_test.py
+++ b/tests/git_cl_test.py
@@ -114,6 +114,11 @@ class TestGitCl(TestCase):
cls._git_upload_calls())
@classmethod
+ def _upload_no_rev_calls(cls, similarity, find_copies):
+ return (cls._git_base_calls(similarity, find_copies) +
+ cls._git_upload_no_rev_calls())
+
+ @classmethod
def _git_base_calls(cls, similarity, find_copies):
if similarity is None:
similarity = '50'
@@ -175,8 +180,15 @@ class TestGitCl(TestCase):
]
@classmethod
+ def _git_upload_no_rev_calls(cls):
+ return [
+ ((['git', '--no-pager', 'config', 'core.editor'],), ''),
+ ]
+
+ @classmethod
def _git_upload_calls(cls):
return [
+ ((['git', '--no-pager', 'config', 'core.editor'],), ''),
((['git', '--no-pager', 'config', 'rietveld.cc'],), ''),
((['git', '--no-pager', 'config', 'branch.master.base-url'],), ''),
((['git', '--no-pager',
@@ -358,7 +370,7 @@ class TestGitCl(TestCase):
find_copies = None
self.calls = self._upload_calls(similarity, find_copies)
- def RunEditor(desc, _):
+ def RunEditor(desc, _, **kwargs):
self.assertEquals(
'# Enter a description of the change.\n'
'# This will be displayed on the codereview site.\n'
@@ -450,8 +462,8 @@ class TestGitCl(TestCase):
mock = FileMock()
try:
- self.calls = self._git_base_calls(None, None)
- def RunEditor(desc, _):
+ self.calls = self._upload_no_rev_calls(None, None)
+ def RunEditor(desc, _, **kwargs):
return desc
self.mock(git_cl.gclient_utils, 'RunEditor', RunEditor)
self.mock(sys, 'stderr', mock)
« no previous file with comments | « tests/basic.sh ('k') | tests/owners.sh » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698