Update web-platform-tests and CSS tests.

- Update CSS tests to revision e05bfd5e30ed662c2f8a353577003f8eed230180.
- Update web-platform-tests to revision a052787dd5c069a340031011196b73affbd68cd9.
This commit is contained in:
Ms2ger 2017-02-06 11:06:12 +01:00
parent fb4f421c8b
commit 296fa2512b
21852 changed files with 2080936 additions and 892894 deletions

View file

@ -1,8 +1,7 @@
import platform
import os
from six import BytesIO
blacklist = ["/tools/", "/resources/", "/common/", "/conformance-checkers/", "/_certs/"]
blacklist_in = ["/resources/", "/support/"]
from six import BytesIO
def rel_path_to_url(rel_path, url_base="/"):
assert not os.path.isabs(rel_path)
@ -12,23 +11,22 @@ def rel_path_to_url(rel_path, url_base="/"):
url_base += "/"
return url_base + rel_path.replace(os.sep, "/")
def is_blacklisted(url):
if "/" not in url[1:]:
return True
for item in blacklist:
if url.startswith(item):
return True
for item in blacklist_in:
if item in url:
return True
return False
def from_os_path(path):
return path.replace(os.path.sep, "/")
assert os.path.sep == "/" or platform.system() == "Windows"
rv = path.replace(os.path.sep, "/")
if "\\" in rv:
raise ValueError("path contains \\ when separator is %s" % os.path.sep)
return rv
def to_os_path(path):
assert os.path.sep == "/" or platform.system() == "Windows"
if "\\" in path:
raise ValueError("normalised path contains \\")
return path.replace("/", os.path.sep)
class ContextManagerBytesIO(BytesIO):
def __enter__(self):
return self
@ -36,6 +34,7 @@ class ContextManagerBytesIO(BytesIO):
def __exit__(self, *args, **kwargs):
self.close()
class cached_property(object):
def __init__(self, func):
self.func = func