W3C test importer should use filesystem instead of os.walk
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Mar 2015 21:02:33 +0000 (21:02 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 Mar 2015 21:02:33 +0000 (21:02 +0000)
commitb9b24edc286e7c7a62a0c25eb1dadeb8b5ae52ba
tree1e8df1b19b4822e66caf1c96a49a98b82a4b3fcd
parent589043fd2fde15203610fbe0c2ca4719a82e1abb
W3C test importer should use filesystem instead of os.walk
https://bugs.webkit.org/show_bug.cgi?id=142085

Reviewed by Bem Jones-Bey.

Added FileSystem.dirs_under to remove the use of os.walk in test importer.
Added MockFileSystem.dirs_under and MockFileSystem.getsize to enable unit testing of test importer.
Added unit test for FileSystem.dirs_under and MockFileSystem.dirs_under.

Made use of FileSystem.dirs_under within TestImporter.find_importable_tests.
Added a unit test to check that test importer is now black-box testable using a Mock system.

* Scripts/webkitpy/common/system/filesystem.py:
(FileSystem.dirs_under): Returns a list of filtered sub-directories.
(FileSystem.dirs_under.filter_all):
* Scripts/webkitpy/common/system/filesystem_mock.py:
(MockFileSystem.dirs_under):
(MockFileSystem.dirs_under.filter_all):
(MockFileSystem.getsize):
* Scripts/webkitpy/common/system/filesystem_mock_unittest.py:
(MockFileSystemTest.test_dirs_under):
(MockFileSystemTest.test_dirs_under.filter_dir):
* Scripts/webkitpy/common/system/filesystem_unittest.py:
(RealFileSystemTest.test_sep):
(RealFileSystemTest):
(RealFileSystemTest.test_dirs_under):
(RealFileSystemTest.test_dirs_under.filter_this_dir):
* Scripts/webkitpy/w3c/test_importer.py:
(TestImporter.do_import):
(TestImporter.find_importable_tests.should_keep_subdir):
(TestImporter.find_importable_tests):
(TestImporter.should_keep_subdir): Deleted.
(TestImporter.should_skip_file): Deleted.
* Scripts/webkitpy/w3c/test_importer_unittest.py:
(TestImporterTest.test_import_dir_with_empty_init_py): Added test to ensure empty __init__.py are no longer empty once imported.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181014 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Tools/ChangeLog
Tools/Scripts/webkitpy/common/system/filesystem.py
Tools/Scripts/webkitpy/common/system/filesystem_mock.py
Tools/Scripts/webkitpy/common/system/filesystem_mock_unittest.py
Tools/Scripts/webkitpy/common/system/filesystem_unittest.py
Tools/Scripts/webkitpy/w3c/test_importer.py
Tools/Scripts/webkitpy/w3c/test_importer_unittest.py