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

Unified Diff: tests/gclient_scm_test.py

Issue 8431021: Handle cases where '.' show up in svn status and is deleted (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/tools/depot_tools
Patch Set: Add another test Created 9 years, 2 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/gclient_scm_test.py
diff --git a/tests/gclient_scm_test.py b/tests/gclient_scm_test.py
index 44d23aa30b8042f8497182208f96477ac7b93cf7..908b322b2d896e9f6a6cae066391e1b75c6dd650 100755
--- a/tests/gclient_scm_test.py
+++ b/tests/gclient_scm_test.py
@@ -196,6 +196,7 @@ class SVNWrapperTestCase(BaseTestCase):
gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
gclient_scm.os.path.isdir(join(self.base_path, '.svn')).AndReturn(True)
gclient_scm.scm.SVN.CaptureStatus(self.base_path).AndReturn([])
+ gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
gclient_scm.scm.SVN.RunAndGetFileList(
options.verbose,
['update', '--revision', 'BASE', '--ignore-externals'],
@@ -222,6 +223,7 @@ class SVNWrapperTestCase(BaseTestCase):
gclient_scm.os.path.islink(file_path).AndReturn(False)
gclient_scm.os.path.isdir(file_path).AndReturn(True)
gclient_scm.gclient_utils.RemoveDirectory(file_path)
+ gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
gclient_scm.scm.SVN.RunAndGetFileList(
options.verbose,
['update', '--revision', 'BASE', '--ignore-externals'],
@@ -235,6 +237,33 @@ class SVNWrapperTestCase(BaseTestCase):
scm.revert(options, self.args, file_list2)
self.checkstdout(('%s\n' % file_path))
+ def testRevertDot(self):
+ self.mox.StubOutWithMock(gclient_scm.SVNWrapper, 'update')
+ options = self.Options(verbose=True)
+ gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
+ gclient_scm.os.path.isdir(join(self.base_path, '.svn')).AndReturn(True)
+ items = [
+ ('~ ', '.'),
+ ]
+ gclient_scm.scm.SVN.CaptureStatus(self.base_path).AndReturn(items)
+ file_path = join(self.base_path, '.')
+ gclient_scm.os.path.exists(file_path).AndReturn(True)
+ gclient_scm.os.path.isfile(file_path).AndReturn(False)
+ gclient_scm.os.path.islink(file_path).AndReturn(False)
+ gclient_scm.os.path.isdir(file_path).AndReturn(True)
+ gclient_scm.gclient_utils.RemoveDirectory(file_path)
+ gclient_scm.os.path.isdir(self.base_path).AndReturn(False)
+ # The mock is unbound so self is not necessary.
+ # pylint: disable=E1120
+ gclient_scm.SVNWrapper.update(options, [], ['.'])
+
+ self.mox.ReplayAll()
+ scm = self._scm_wrapper(url=self.url, root_dir=self.root_dir,
+ relpath=self.relpath)
+ file_list2 = []
+ scm.revert(options, self.args, file_list2)
+ self.checkstdout(('%s\n' % file_path))
+
def testStatus(self):
options = self.Options(verbose=True)
gclient_scm.os.path.isdir(self.base_path).AndReturn(True)
« 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