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

Unified Diff: Tools/Scripts/webkitpy/common/system/filesystem_mock.py

Issue 500453002: Extend functionality of MockFileSystem.move() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase Created 6 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 | Tools/Scripts/webkitpy/common/system/filesystem_unittest.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Tools/Scripts/webkitpy/common/system/filesystem_mock.py
diff --git a/Tools/Scripts/webkitpy/common/system/filesystem_mock.py b/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
index 3e06339ec438d31a612ff83684ecbaf6378e1e16..0dbf74d8a4ab3ff7d4007104bcd280c2085616e4 100644
--- a/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
+++ b/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
@@ -268,12 +268,16 @@ class MockFileSystem(object):
norm_path = self.dirname(norm_path)
def move(self, source, destination):
- if self.files[source] is None:
+ if not self.exists(source):
self._raise_not_found(source)
- self.files[destination] = self.files[source]
- self.written_files[destination] = self.files[destination]
- self.files[source] = None
- self.written_files[source] = None
+ if self.isfile(source):
+ self.files[destination] = self.files[source]
+ self.written_files[destination] = self.files[destination]
+ self.files[source] = None
+ self.written_files[source] = None
+ return
+ self.copytree(source, destination)
+ self.rmtree(source)
def _slow_but_correct_normpath(self, path):
return re.sub(re.escape(os.path.sep), self.sep, os.path.normpath(path))
« no previous file with comments | « no previous file | Tools/Scripts/webkitpy/common/system/filesystem_unittest.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698