| Index: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier_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_copier_unittest.py
|
| similarity index 68%
|
| copy from third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
|
| copy to third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier_unittest.py
|
| index ba022f78c32ab341133fd79254f1e0603d701f15..3967a347d1ad963e277c7d9cea0f798bcc80fcfa 100644
|
| --- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
|
| +++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_copier_unittest.py
|
| @@ -30,7 +30,7 @@ import unittest
|
| from webkitpy.common.host_mock import MockHost
|
| from webkitpy.common.system.executive_mock import MockExecutive, ScriptError
|
| from webkitpy.common.system.filesystem_mock import MockFileSystem
|
| -from webkitpy.w3c.test_importer import TestImporter
|
| +from webkitpy.w3c.test_copier import TestCopier
|
|
|
|
|
| FAKE_SOURCE_REPO_DIR = '/blink'
|
| @@ -48,34 +48,34 @@ FAKE_FILES = {
|
| }
|
|
|
|
|
| -class TestImporterTest(unittest.TestCase):
|
| +class TestCopierTest(unittest.TestCase):
|
|
|
| def test_import_dir_with_no_tests(self):
|
| host = MockHost()
|
| host.executive = MockExecutive(exception=ScriptError('error'))
|
| host.filesystem = MockFileSystem(files=FAKE_FILES)
|
| - importer = TestImporter(host, FAKE_SOURCE_REPO_DIR, 'destination')
|
| - importer.do_import() # No exception raised.
|
| + copier = TestCopier(host, FAKE_SOURCE_REPO_DIR, 'destination')
|
| + copier.do_import() # No exception raised.
|
|
|
| def test_path_too_long_true(self):
|
| 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'))
|
| + copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
|
| + self.assertTrue(copier.path_too_long(FAKE_SOURCE_REPO_DIR + '/' + ('x' * 150) + '.html'))
|
|
|
| def test_path_too_long_false(self):
|
| 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'))
|
| + copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
|
| + self.assertFalse(copier.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)
|
| - importer.find_importable_tests()
|
| + copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
|
| + copier.find_importable_tests()
|
| self.assertEqual(
|
| - importer.import_list,
|
| + copier.import_list,
|
| [
|
| {
|
| 'copy_list': [
|
| @@ -92,10 +92,10 @@ 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)
|
| - importer.find_importable_tests()
|
| + copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
|
| + copier.find_importable_tests()
|
| self.assertEqual(
|
| - importer.import_list,
|
| + copier.import_list,
|
| [
|
| {
|
| 'copy_list': [
|
| @@ -112,8 +112,8 @@ 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)
|
| - importer.do_import()
|
| + copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
|
| + copier.do_import()
|
| self.assertEqual(
|
| host.filesystem.executable_files,
|
| set(['/mock-checkout/third_party/WebKit/LayoutTests/external/blink/w3c/dir/has_shebang.txt']))
|
| @@ -126,10 +126,10 @@ 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)
|
| - importer.find_importable_tests()
|
| + copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
|
| + copier.find_importable_tests()
|
| self.assertEqual(
|
| - importer.import_list,
|
| + copier.import_list,
|
| [
|
| {
|
| 'copy_list': [
|
| @@ -151,27 +151,27 @@ 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)
|
| - importer.find_importable_tests()
|
| - self.assertEqual(importer.import_list, [])
|
| + copier = TestCopier(host, FAKE_SOURCE_REPO_DIR)
|
| + copier.find_importable_tests()
|
| + self.assertEqual(copier.import_list, [])
|
|
|
| def test_should_try_to_convert_positive_cases(self):
|
| - self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.css', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.htm', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.html', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.xht', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertTrue(TestImporter.should_try_to_convert({}, 'foo.xhtml', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.css', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.htm', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.html', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.xht', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertTrue(TestCopier.should_try_to_convert({}, 'foo.xhtml', 'LayoutTests/external/csswg-test/x'))
|
|
|
| def test_should_not_try_to_convert_js_test(self):
|
| - self.assertFalse(TestImporter.should_try_to_convert({'is_jstest': True}, 'foo.html', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertFalse(TestCopier.should_try_to_convert({'is_jstest': True}, 'foo.html', 'LayoutTests/external/csswg-test/x'))
|
|
|
| def test_should_not_try_to_convert_test_in_wpt(self):
|
| - self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.html', 'LayoutTests/external/wpt/foo'))
|
| + self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.html', 'LayoutTests/external/wpt/foo'))
|
|
|
| def test_should_not_try_to_convert_other_file_types(self):
|
| - self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.bar', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.js', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.md', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.png', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.svg', 'LayoutTests/external/csswg-test/x'))
|
| - self.assertFalse(TestImporter.should_try_to_convert({}, 'foo.svgz', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.bar', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.js', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.md', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.png', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.svg', 'LayoutTests/external/csswg-test/x'))
|
| + self.assertFalse(TestCopier.should_try_to_convert({}, 'foo.svgz', 'LayoutTests/external/csswg-test/x'))
|
|
|