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

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: mlg rebasing 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..d747024748a140d3bc46cddbd994b958f1ba2644 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)
+
+ for root, dirs, files in file_system.Walk('', depth=1):
+ all_dirs.extend(dirs)
+ all_files.extend(files)
+ self.assertEqual(['templates/'], all_dirs)
+ self.assertEqual(['file.txt'], all_files)
+
+ 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(['templates/', 'public/', 'json/']),
+ sorted(all_dirs))
+ self.assertEqual(sorted(['file.txt', 'README']), sorted(all_files))
+
+
def testSubWalk(self):
expected_files = set([
'/redirects.json',
« no previous file with comments | « chrome/common/extensions/docs/server2/file_system.py ('k') | chrome/common/extensions/docs/server2/owners_data_source.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698