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

Unified Diff: tests/scm_unittest.py

Issue 10826035: Fix error syncing to LKGR due to misparsing of Cygwin git-svn output. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Adding test for git-svn SHA1 output parsing 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 | « scm.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/scm_unittest.py
diff --git a/tests/scm_unittest.py b/tests/scm_unittest.py
index ca17cd39ad23bd11c51047e5ba0b92495edc8429..ca50790be5415be0071aff1c1a4be35f2f6f1ec9 100755
--- a/tests/scm_unittest.py
+++ b/tests/scm_unittest.py
@@ -92,6 +92,7 @@ class GitWrapperTestCase(BaseSCMTestCase):
'IsGitSvn',
'IsValidRevision',
'MatchSvnGlob',
+ 'ParseGitSvnSha1',
'ShortBranchName',
]
# If this test fails, you should add the relevant test.
@@ -167,6 +168,16 @@ class RealGitSvnTest(fake_repos.FakeReposTestBase):
self._capture(['reset', '--hard', 'HEAD^'])
self.assertEquals(scm.GIT.GetGitSvnHeadRev(cwd=self.clone_dir), 1)
+ def testParseGitSvnSha1(self):
+ test_sha1 = 'a5c63ce8671922e5c59c0dea49ef4f9d4a3020c9'
+ expected_output = test_sha1 + '\n'
+ # Cygwin git-svn 1.7.9 prints extra escape sequences when run under
+ # TERM=xterm
+ cygwin_output = test_sha1 + '\n\033[?1034h'
Dirk Pranke 2012/08/09 18:52:23 Great, this is what I was looking for ...
+
+ self.assertEquals(scm.GIT.ParseGitSvnSha1(expected_output), test_sha1)
+ self.assertEquals(scm.GIT.ParseGitSvnSha1(cygwin_output), test_sha1)
+
def testGetGetSha1ForSvnRev(self):
if not self.enabled:
return
« no previous file with comments | « scm.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698