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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock_walk_unittest.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_walk_unittest.py
diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock_walk_unittest.py
similarity index 88%
copy from third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock_unittest.py
copy to third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock_walk_unittest.py
index 561959ad5610989b637af3d5c0ee344c251afb2b..c0abdc462041f847709e988f99cd6d65f8fcdb7d 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/common/system/filesystem_mock_walk_unittest.py
@@ -28,10 +28,17 @@
import unittest
-
+from webkitpy.common.host_mock import MockHost
from webkitpy.common.system import filesystem_mock
+from webkitpy.common.system.filesystem_mock import MockFileSystem
from webkitpy.common.system import filesystem_unittest
+MOCK_DIR = 'foo'
+MOCK_FILES = {'foo/bar/baz': '',
+ 'foo/a': '',
+ 'foo/b': '',
+ 'foo/c': ''}
qyearsley 2016/06/01 23:08:43 These don't have to be globals now; they could be
+
class MockFileSystemTest(unittest.TestCase, filesystem_unittest.GenericFileSystemTests):
@@ -84,3 +91,9 @@ class MockFileSystemTest(unittest.TestCase, filesystem_unittest.GenericFileSyste
def test_relpath_win32(self):
pass
+
+ def test_filesystem_walk(self):
qyearsley 2016/06/01 23:08:43 I'm not quite sure whether this walk method will w
+ host = MockHost()
+ host.filesystem = MockFileSystem(files=MOCK_FILES)
+ host.filesystem.walk(MOCK_DIR)
qyearsley 2016/06/01 23:08:43 self.assertEqual( [ ('foo', ['bar'], [
+ self.assertTrue(False)
qyearsley 2016/06/01 23:08:43 This line should be removed.

Powered by Google App Engine
This is Rietveld 408576698