2 # Copyright 2013 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file.
8 from test_file_system
import TestFileSystem
10 file_system
= TestFileSystem({
21 'redirects.json': 'redirect'
24 'manifest.json': 'manifest'
29 class FileSystemTest(unittest
.TestCase
):
31 expected_files
= set([
32 'templates/public/apps/404.html',
33 'templates/public/apps/a11y.html',
34 'templates/public/extensions/404.html',
35 'templates/public/extensions/cookies.html',
36 'templates/public/redirects.json',
37 'templates/json/manifest.json'
43 'templates/public/apps/',
44 'templates/public/extensions/',
50 for root
, dirs
, files
in file_system
.Walk(''):
51 all_files
.update(root
+ '/' + name
for name
in files
)
52 all_dirs
.update(root
+ '/' + name
for name
in dirs
)
54 self
.assertEqual(expected_files
, all_files
)
55 self
.assertEqual(expected_dirs
, all_dirs
)
57 def testSubWalk(self
):
58 expected_files
= set([
62 'extensions/404.html',
63 'extensions/cookies.html'
67 for root
, dirs
, files
in file_system
.Walk('templates/public'):
68 all_files
.update(root
+ '/' + name
for name
in files
)
70 self
.assertEqual(expected_files
, all_files
)
72 if __name__
== '__main__':