Chromium Code Reviews| Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py |
| diff --git a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py |
| index 2984d842895b74c8857c2dfb54b7806906427444..c6d599edeb8679675976b80d21f8facf2cb920d3 100644 |
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py |
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py |
| @@ -25,7 +25,6 @@ |
| # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
| # SUCH DAMAGE. |
| -import optparse |
| import unittest |
| from webkitpy.common.host_mock import MockHost |
| @@ -37,52 +36,44 @@ from webkitpy.w3c.test_importer import TestImporter |
| FAKE_SOURCE_REPO_DIR = '/blink' |
| FAKE_FILES = { |
| - '/mock-checkout/third_party/Webkit/LayoutTests/w3c/OWNERS': '', |
| + '/mock-checkout/third_party/Webkit/LayoutTests/imported/OWNERS': '', |
| '/blink/w3c/dir/has_shebang.txt': '#!', |
| '/blink/w3c/dir/README.txt': '', |
| '/blink/w3c/dir/OWNERS': '', |
| '/blink/w3c/dir/reftest.list': '', |
| '/blink/w3c/dir1/OWNERS': '', |
| '/blink/w3c/dir1/reftest.list': '', |
| - '/mock-checkout/third_party/WebKit/LayoutTests/w3c/README.txt': '', |
| + '/mock-checkout/third_party/WebKit/LayoutTests/imported/README.txt': '', |
|
jeffcarp
2017/01/18 20:43:42
Should this be `external` now?
qyearsley
2017/01/18 23:10:58
Yep! Now changed.
|
| '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations': '', |
| } |
| class TestImporterTest(unittest.TestCase): |
| - @staticmethod |
| - def options(**kwargs): |
| - """Returns a set of option values for TestImporter.""" |
| - options = { |
| - "overwrite": False, |
| - "destination": "w3c", |
| - "ignore_expectations": False, |
| - "dry_run": False, |
| - } |
| - options.update(kwargs) |
| - return optparse.Values(options) |
| - |
| def test_import_dir_with_no_tests(self): |
| host = MockHost() |
| host.executive = MockExecutive(exception=ScriptError( |
| - "abort: no repository found in '/Volumes/Source/src/wk/Tools/Scripts/webkitpy/w3c'")) |
| + "abort: no repository found in '/Volumes/Source/src/wk/Tools/Scripts/webkitpy/imported'")) |
| host.filesystem = MockFileSystem(files=FAKE_FILES) |
| - importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) |
| + importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, 'destination') |
| importer.do_import() # No exception raised. |
| def test_path_too_long_true(self): |
| - importer = TestImporter(MockHost(), FAKE_SOURCE_REPO_DIR, self.options()) |
| + host = MockHost() |
| + host.filesystem = MockFileSystem(files=FAKE_FILES) |
| + importer = TestImporter(host, FAKE_SOURCE_REPO_DIR) |
| self.assertTrue(importer.path_too_long(FAKE_SOURCE_REPO_DIR + '/' + ('x' * 150) + '.html')) |
| def test_path_too_long_false(self): |
| - importer = TestImporter(MockHost(), FAKE_SOURCE_REPO_DIR, self.options()) |
| + host = MockHost() |
| + host.filesystem = MockFileSystem(files=FAKE_FILES) |
| + importer = TestImporter(host, FAKE_SOURCE_REPO_DIR) |
| self.assertFalse(importer.path_too_long(FAKE_SOURCE_REPO_DIR + '/x.html')) |
| def test_does_not_import_owner_files(self): |
| host = MockHost() |
| host.filesystem = MockFileSystem(files=FAKE_FILES) |
| - importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) |
| + importer = TestImporter(host, FAKE_SOURCE_REPO_DIR) |
| importer.find_importable_tests() |
| self.assertEqual( |
| importer.import_list, |
| @@ -102,7 +93,7 @@ class TestImporterTest(unittest.TestCase): |
| def test_does_not_import_reftestlist_file(self): |
| host = MockHost() |
| host.filesystem = MockFileSystem(files=FAKE_FILES) |
| - importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) |
| + importer = TestImporter(host, FAKE_SOURCE_REPO_DIR) |
| importer.find_importable_tests() |
| self.assertEqual( |
| importer.import_list, |
| @@ -122,11 +113,11 @@ class TestImporterTest(unittest.TestCase): |
| def test_files_with_shebang_are_made_executable(self): |
| host = MockHost() |
| host.filesystem = MockFileSystem(files=FAKE_FILES) |
| - importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) |
| + importer = TestImporter(host, FAKE_SOURCE_REPO_DIR) |
| importer.do_import() |
| self.assertEqual( |
| host.filesystem.executable_files, |
| - set(['/mock-checkout/third_party/WebKit/LayoutTests/w3c/blink/w3c/dir/has_shebang.txt'])) |
| + set(['/mock-checkout/third_party/WebKit/LayoutTests/imported/blink/w3c/dir/has_shebang.txt'])) |
| def test_ref_test_with_ref_is_copied(self): |
| host = MockHost() |
| @@ -136,7 +127,7 @@ class TestImporterTest(unittest.TestCase): |
| '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations': '', |
| '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in': '', |
| }) |
| - importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) |
| + importer = TestImporter(host, FAKE_SOURCE_REPO_DIR) |
| importer.find_importable_tests() |
| self.assertEqual( |
| importer.import_list, |
| @@ -161,7 +152,7 @@ class TestImporterTest(unittest.TestCase): |
| '/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations': '', |
| '/mock-checkout/third_party/WebKit/Source/core/css/CSSProperties.in': '', |
| }) |
| - importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, self.options()) |
| + importer = TestImporter(host, FAKE_SOURCE_REPO_DIR) |
| importer.find_importable_tests() |
| self.assertEqual(importer.import_list, []) |