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

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

Issue 2029823002: Fix MockFileSystem.walk and add test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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
Index: third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
index 6b6e7c9f422f91384cdd33c5fac50ab0387471e3..81ea3ac03c17957c129f3ef0c38fc631264d30e4 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock.py
@@ -205,6 +205,7 @@ class MockFileSystem(object):
return dirs + files
def walk(self, top):
+ FILE_SYSTEM_TUPLES = []
qyearsley 2016/06/01 23:08:43 Non-global variable names use lowercase with under
sep = self.sep
if not self.isdir(top):
raise OSError("%s is not a directory" % top)
@@ -223,7 +224,12 @@ class MockFileSystem(object):
dirs.append(dir)
else:
files.append(remaining)
- return [(top[:-1], dirs, files)]
+ FILE_SYSTEM_TUPLES = [(top[:-1], dirs, files)]
+ for dir in dirs:
+ dir = top + dir
+ subdir = self.walk(dir)
qyearsley 2016/06/01 23:08:43 This variable name could probably be improved; is
+ FILE_SYSTEM_TUPLES += subdir
+ return FILE_SYSTEM_TUPLES
def mtime(self, path):
if self.exists(path):

Powered by Google App Engine
This is Rietveld 408576698