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

Unified Diff: tests/scm_unittest.py

Issue 6578029: Fix scm.SVN.GetCheckoutRoot() so it is not confused by intermixed checkouts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Created 9 years, 10 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 7a3cbbb29d22e3368ecc9d8836710de4813ed40e..48882f95be94a177c522f78ef6bd5c7b6ef94bac 100755
--- a/tests/scm_unittest.py
+++ b/tests/scm_unittest.py
@@ -85,16 +85,23 @@ class SVNTestCase(BaseSCMTestCase):
def testGetCheckoutRoot(self):
self.mox.StubOutWithMock(scm.SVN, 'CaptureInfo')
self.mox.StubOutWithMock(scm, 'GetCasedPath')
- scm.os.path.abspath(self.root_dir + 'x').AndReturn(self.root_dir)
- scm.GetCasedPath(self.root_dir).AndReturn(self.root_dir)
- result1 = { "Repository Root": "Some root" }
- scm.SVN.CaptureInfo(self.root_dir).AndReturn(result1)
- results2 = { "Repository Root": "A different root" }
- scm.SVN.CaptureInfo(
- scm.os.path.dirname(self.root_dir)).AndReturn(results2)
+ scm.os.path.abspath = lambda x: x
+ scm.GetCasedPath = lambda x: x
+ scm.SVN.CaptureInfo(self.root_dir + '/foo/bar').AndReturn({
+ 'Repository Root': 'svn://svn.chromium.org/chrome',
+ 'URL': 'svn://svn.chromium.org/chrome/trunk/src',
+ })
+ scm.SVN.CaptureInfo(self.root_dir + '/foo').AndReturn({
+ 'Repository Root': 'svn://svn.chromium.org/chrome',
+ 'URL': 'svn://svn.chromium.org/chrome/trunk',
+ })
+ scm.SVN.CaptureInfo(self.root_dir).AndReturn({
+ 'Repository Root': 'svn://svn.chromium.org/chrome',
+ 'URL': 'svn://svn.chromium.org/chrome/trunk/tools/commit-queue/workdir',
+ })
self.mox.ReplayAll()
- self.assertEquals(scm.SVN.GetCheckoutRoot(self.root_dir + 'x'),
- self.root_dir)
+ self.assertEquals(scm.SVN.GetCheckoutRoot(self.root_dir + '/foo/bar'),
+ self.root_dir + '/foo')
def testGetFileInfo(self):
xml_text = r"""<?xml version="1.0"?>
« 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