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

Unified Diff: chrome/common/extensions/docs/server2/file_system_test.py

Issue 453713002: Docserver: Generate a table of extension/app API owners (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
Index: chrome/common/extensions/docs/server2/file_system_test.py
diff --git a/chrome/common/extensions/docs/server2/file_system_test.py b/chrome/common/extensions/docs/server2/file_system_test.py
index 116f12dcab87f05105d4491c065b0b8079dd2958..158f9a49ec6d524c1b6ff6aacf820a6b4e7c376f 100755
--- a/chrome/common/extensions/docs/server2/file_system_test.py
+++ b/chrome/common/extensions/docs/server2/file_system_test.py
@@ -59,6 +59,31 @@ class FileSystemTest(unittest.TestCase):
self.assertEqual(sorted(expected_files), sorted(all_files))
self.assertEqual(sorted(expected_dirs), sorted(all_dirs))
+ def testWalkDepth(self):
+ all_dirs = []
+ all_files = []
+ for root, dirs, files in file_system.Walk('', depth=0):
+ all_dirs.extend(dirs)
+ all_files.extend(files)
+ self.assertEqual(all_dirs, [])
+ self.assertEqual(all_files, [])
not at google - send to devlin 2014/08/21 21:39:58 For all of these, the expectation should go first.
+
+ for root, dirs, files in file_system.Walk('', depth=1):
+ all_dirs.extend(dirs)
+ all_files.extend(files)
+ self.assertEqual(all_dirs, ['templates/'])
+ self.assertEqual(all_files, ['file.txt'])
+
+ all_dirs = []
+ all_files = []
+ for root, dirs, files in file_system.Walk('', depth=2):
+ all_dirs.extend(dirs)
+ all_files.extend(files)
+ self.assertEqual(sorted(all_dirs),
+ sorted(['templates/', 'public/', 'json/']))
+ self.assertEqual(sorted(all_files), sorted(['file.txt', 'README']))
+
+
def testSubWalk(self):
expected_files = set([
'/redirects.json',

Powered by Google App Engine
This is Rietveld 408576698