Update web-platform-tests to revision 614fd870e47c9f4e76291e5af4e32b676c0acac0

This commit is contained in:
WPT Sync Bot 2018-12-04 20:30:20 -05:00
parent 063bd7ac19
commit b49ffaa0f7
137 changed files with 4756 additions and 721 deletions

View file

@ -71,6 +71,9 @@ def all_filesystem_paths(repo_root, subdir=None):
for dirpath, dirnames, filenames in path_filter(walk(expanded_path)):
for filename, _ in filenames:
path = os.path.join(dirpath, filename)
if subdir:
path = os.path.join(subdir, path)
assert not os.path.isabs(path), path
yield path

View file

@ -415,6 +415,23 @@ def test_all_filesystem_paths():
os.path.join('dir_a', 'file_d')]
def test_filesystem_paths_subdir():
with mock.patch(
'tools.lint.lint.walk',
return_value=[('',
[('dir_a', None), ('dir_b', None)],
[('file_a', None), ('file_b', None)]),
('dir_a',
[],
[('file_c', None), ('file_d', None)])]
):
got = list(lint_mod.all_filesystem_paths('.', 'dir'))
assert got == [os.path.join('dir', 'file_a'),
os.path.join('dir', 'file_b'),
os.path.join('dir', 'dir_a', 'file_c'),
os.path.join('dir', 'dir_a', 'file_d')]
def test_main_with_args():
orig_argv = sys.argv
try: