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

Unified Diff: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_OWNERS_unittest.py

Issue 2029823002: Fix MockFileSystem.walk and add test. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Import Expectations Modified Created 4 years, 7 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: third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_OWNERS_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_OWNERS_unittest.py
similarity index 75%
copy from third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
copy to third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_OWNERS_unittest.py
index 6fdfc2fd4f0a0d54913bad431cae0a12914d471b..8bc446040d42189f8d0bfc987d92eb38622cd809 100644
--- a/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_importer_unittest.py
+++ b/third_party/WebKit/Tools/Scripts/webkitpy/w3c/test_OWNERS_unittest.py
@@ -39,7 +39,10 @@ FAKE_SOURCE_DIR = '/blink/w3c'
FAKE_REPO_DIR = '/blink'
FAKE_FILES = {
+ '/mock-checkout/third_party/Webkit/LayoutTests/w3c/OWNERS': '',
'/blink/w3c/empty_dir/README.txt': '',
+ '/blink/w3c/empty_dir/OWNERS': '',
qyearsley 2016/06/02 14:24:38 It's slightly confusing that there's a non-empty d
+ '/blink/w3c/dir1/OWNERS': '',
'/mock-checkout/third_party/WebKit/LayoutTests/w3c/README.txt': '',
'/mock-checkout/third_party/WebKit/LayoutTests/W3CImportExpectations': '',
}
@@ -58,27 +61,14 @@ class TestImporterTest(unittest.TestCase):
options.update(kwargs)
return optparse.Values(options)
- def test_import_dir_with_no_tests(self):
+ def test_does_not_import_owner_files(self):
host = MockHost()
- host.executive = MockExecutive2(exception=ScriptError(
- "abort: no repository found in '/Volumes/Source/src/wk/Tools/Scripts/webkitpy/w3c'"))
host.filesystem = MockFileSystem(files=FAKE_FILES)
importer = TestImporter(host, FAKE_SOURCE_DIR, FAKE_REPO_DIR, self.options())
-
- oc = OutputCapture()
- oc.capture_output()
- try:
- importer.do_import()
- finally:
- oc.restore_output()
-
- def test_path_too_long_true(self):
- importer = TestImporter(MockHost(), FAKE_SOURCE_DIR, FAKE_REPO_DIR, self.options())
- self.assertTrue(importer.path_too_long(FAKE_REPO_DIR + '/' + ('x' * 150) + '.html'))
-
- def test_path_too_long_false(self):
- importer = TestImporter(MockHost(), FAKE_SOURCE_DIR, FAKE_REPO_DIR, self.options())
- self.assertFalse(importer.path_too_long(FAKE_REPO_DIR + '/x.html'))
-
- # FIXME: Needs more tests.
+ importer.find_importable_tests(FAKE_REPO_DIR)
+ self.assertEqual(importer.import_list, [{'copy_list': [{'dest': 'README.txt', 'src': '/blink/w3c/empty_dir/README.txt'}],
+ 'dirname': '/blink/w3c/empty_dir',
+ 'jstests': 0,
+ 'reftests': 0,
+ 'total_tests': 0, }])
qyearsley 2016/06/02 14:24:38 Formatting nit: line 70 is quite long, and line 74

Powered by Google App Engine
This is Rietveld 408576698