Update web-platform-tests to revision c2b30ef30749b6a8f2cc832761dfe011e63d5e94

This commit is contained in:
WPT Sync Bot 2018-10-05 21:34:34 -04:00
parent 987e376ca7
commit eda9b9b73a
142 changed files with 3513 additions and 851 deletions

View file

@ -2,7 +2,7 @@ marionette_driver==2.7.0
mozprofile==2.0.0
mozprocess == 0.26
mozcrash == 1.0
mozrunner==7.0.2
mozrunner==7.1.0
mozleak == 0.1
mozinstall==1.16.0
mozdownload==1.24

View file

@ -15,7 +15,7 @@ a dictionary with the fields
"executor_kwargs": String naming a function that takes http server url and
timeout multiplier and returns kwargs to use when creating
the executor class.
"env_options": String naming a funtion of no arguments that returns the
"env_options": String naming a function of no arguments that returns the
arguments passed to the TestEnvironment.
All classes and functions named in the above dict must be imported into the

View file

@ -88,19 +88,16 @@ class TestFileHandler(TestUsingServer):
self.request("/document.txt", headers={"Range":"bytes=%i-%i" % (len(expected), len(expected) + 10)})
self.assertEqual(cm.exception.code, 416)
@pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
def test_sub_config(self):
resp = self.request("/sub.sub.txt")
expected = b"localhost localhost %i" % self.server.port
assert resp.read().rstrip() == expected
@pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
def test_sub_headers(self):
resp = self.request("/sub_headers.sub.txt", headers={"X-Test": "PASS"})
expected = b"PASS"
assert resp.read().rstrip() == expected
@pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
def test_sub_params(self):
resp = self.request("/sub_params.sub.txt", query="test=PASS")
expected = b"PASS"

View file

@ -178,7 +178,6 @@ class TestPipesWithVariousHandlers(TestUsingServer):
self.assertFalse(resp.info().get("X-TEST"))
self.assertEqual(resp.read(), b"CONTENT")
@pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
def test_with_json_handler(self):
@wptserve.handlers.json_handler
def handler(request, response):
@ -186,7 +185,7 @@ class TestPipesWithVariousHandlers(TestUsingServer):
route = ("GET", "/test/test_pipes_2/", handler)
self.server.router.register(*route)
resp = self.request(route[1], query="pipe=slice(null,2)")
self.assertEqual(resp.read(), '"{')
self.assertEqual(resp.read(), b'"{')
def test_slice_with_as_is_handler(self):
resp = self.request("/test.asis", query="pipe=slice(null,2)")

View file

@ -273,8 +273,9 @@ def slice(request, response, start, end=None):
(spelled "null" in a query string) to indicate the end of
the file.
"""
content = resolve_content(response)
response.content = content[start:end]
content = resolve_content(response)[start:end]
response.content = content
response.headers.set("Content-Length", len(content))
return response
@ -425,11 +426,12 @@ def template(request, content, escape_type="html"):
tokens = deque(tokens)
token_type, field = tokens.popleft()
field = field.decode("ascii")
assert isinstance(field, text_type)
if token_type == "var":
variable = field
token_type, field = tokens.popleft()
assert isinstance(field, text_type)
else:
variable = None