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

Unified Diff: tests/trychange_unittest.py

Issue 10836180: Make git try warn on a dirty index. (Closed) Base URL: http://src.chromium.org/svn/trunk/tools/depot_tools/
Patch Set: minimize unittest diff a bit... Created 8 years, 4 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 | « no previous file | trychange.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/trychange_unittest.py
===================================================================
--- tests/trychange_unittest.py (revision 151034)
+++ tests/trychange_unittest.py (working copy)
@@ -22,6 +22,7 @@
def setUp(self):
SuperMoxTestBase.setUp(self)
self.mox.StubOutWithMock(subprocess2, 'communicate')
+ self.mox.StubOutWithMock(trychange, 'RunGit')
self.mox.StubOutWithMock(trychange.scm.GIT, 'Capture')
self.mox.StubOutWithMock(trychange.scm.GIT, 'GenerateDiff')
self.mox.StubOutWithMock(trychange.scm.GIT, 'GetCheckoutRoot')
@@ -46,14 +47,12 @@
"""General trychange.py tests."""
def testMembersChanged(self):
members = [
- 'EPILOG', 'Escape', 'GIT', 'GuessVCS', 'GetMungedDiff', 'HELP_STRING',
- 'InvalidScript', 'NoTryServerAccess', 'PrintSuccess', 'SCM', 'SVN',
- 'TryChange', 'USAGE',
- 'breakpad', 'datetime', 'errno', 'fix_encoding', 'gcl', 'gclient_utils',
- 'getpass', 'gen_parser',
- 'json', 'logging', 'optparse', 'os', 'posixpath', 're', 'scm', 'shutil',
- 'subprocess2', 'sys', 'tempfile', 'urllib',
- ]
+ 'DieWithError', 'EPILOG', 'Escape', 'GIT', 'GetMungedDiff', 'GuessVCS',
+ 'HELP_STRING', 'InvalidScript', 'NoTryServerAccess', 'PrintSuccess',
+ 'RunCommand', 'RunGit', 'SCM', 'SVN', 'TryChange', 'USAGE', 'breakpad',
+ 'datetime', 'errno', 'fix_encoding', 'gcl', 'gclient_utils', 'gen_parser',
+ 'getpass', 'json', 'logging', 'optparse', 'os', 'posixpath', 're', 'scm',
+ 'shutil', 'subprocess2', 'sys', 'tempfile', 'urllib']
# If this test fails, you should add the relevant test.
self.compareMembers(trychange, members)
@@ -138,6 +137,7 @@
trychange.os.path.abspath(self.fake_root).AndReturn(self.fake_root)
trychange.scm.GIT.GetCheckoutRoot(self.fake_root).AndReturn(self.fake_root)
trychange.scm.GIT.GetUpstreamBranch(self.fake_root).AndReturn('somewhere')
+ trychange.RunGit(['diff-index', 'HEAD'])
trychange.scm.GIT.GenerateDiff(self.fake_root,
full_move=True,
files=['foo.txt', 'bar.txt'],
« no previous file with comments | « no previous file | trychange.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698