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

Unified Diff: tests/git_common_test.py

Issue 1150353003: Make git auto-svn fail if git svn fetch fails. (Closed) Base URL: https://chromium.googlesource.com/chromium/tools/depot_tools.git@master
Patch Set: + Tests. Created 5 years, 6 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 | « git_common.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/git_common_test.py
diff --git a/tests/git_common_test.py b/tests/git_common_test.py
index 5ba00b25791c52246f78fdf0751ffcf2c3c1c1d7..dc40c043e5e9e9670e9d076129190e53b23a0e86 100755
--- a/tests/git_common_test.py
+++ b/tests/git_common_test.py
@@ -221,6 +221,24 @@ class GitReadOnlyFunctionsTest(git_test_utils.GitRepoReadOnlyTestBase,
self.repo.run(testfn)
+ def testStreamWithRetcode(self):
+ items = set(self.repo.commit_map.itervalues())
+
+ def testfn():
+ with self.gc.run_stream_with_retcode('log', '--format=%H') as stdout:
+ for line in stdout.xreadlines():
+ line = line.strip()
+ self.assertIn(line, items)
+ items.remove(line)
+
+ self.repo.run(testfn)
+
+ def testStreamWithRetcodeException(self):
+ import subprocess2
+ with self.assertRaises(subprocess2.CalledProcessError):
+ with self.gc.run_stream_with_retcode('checkout', 'unknown-branch'):
+ pass
+
def testCurrentBranch(self):
def cur_branch_out_of_git():
os.chdir('..')
« no previous file with comments | « git_common.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698