Bug 1494256 [wpt PR 13217] - Fix some test expectations in test_handlers.py., a=testonly
authorMs2ger <Ms2ger@gmail.com>
Wed, 03 Oct 2018 09:30:40 +0000
changeset 495420 e51148e4e5f79983b8a8dcbfa6428cd893d09db5
parent 495419 03b30fa29e8c333a36fe14c917675edbe6e52286
child 495421 6ef563b9dcda39346a9cacd530eae6c7c9c18916
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstestonly
bugs1494256, 13217
milestone64.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1494256 [wpt PR 13217] - Fix some test expectations in test_handlers.py., a=testonly Automatic update from web-platform-testsFix some test expectations in test_handlers.py. -- wpt-commits: 00416a6433ea2ea75f09d9bfb446f7a1421272c1 wpt-pr: 13217
testing/web-platform/tests/tools/wptserve/tests/functional/test_handlers.py
--- a/testing/web-platform/tests/tools/wptserve/tests/functional/test_handlers.py
+++ b/testing/web-platform/tests/tools/wptserve/tests/functional/test_handlers.py
@@ -100,82 +100,78 @@ class TestFileHandler(TestUsingServer):
 
     def test_sub_params(self):
         resp = self.request("/sub_params.sub.txt", query="test=PASS")
         expected = b"PASS"
         assert resp.read().rstrip() == expected
 
 
 class TestFunctionHandler(TestUsingServer):
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_string_rv(self):
         @wptserve.handlers.handler
         def handler(request, response):
             return "test data"
 
         route = ("GET", "/test/test_string_rv", handler)
         self.server.router.register(*route)
         resp = self.request(route[1])
         self.assertEqual(200, resp.getcode())
         self.assertEqual("9", resp.info()["Content-Length"])
-        self.assertEqual("test data", resp.read())
+        self.assertEqual(b"test data", resp.read())
 
     def test_tuple_1_rv(self):
         @wptserve.handlers.handler
         def handler(request, response):
             return ()
 
         route = ("GET", "/test/test_tuple_1_rv", handler)
         self.server.router.register(*route)
 
         with pytest.raises(HTTPError) as cm:
             self.request(route[1])
 
         assert cm.value.code == 500
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_tuple_2_rv(self):
         @wptserve.handlers.handler
         def handler(request, response):
             return [("Content-Length", 4), ("test-header", "test-value")], "test data"
 
         route = ("GET", "/test/test_tuple_2_rv", handler)
         self.server.router.register(*route)
         resp = self.request(route[1])
         self.assertEqual(200, resp.getcode())
         self.assertEqual("4", resp.info()["Content-Length"])
         self.assertEqual("test-value", resp.info()["test-header"])
-        self.assertEqual("test", resp.read())
+        self.assertEqual(b"test", resp.read())
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_tuple_3_rv(self):
         @wptserve.handlers.handler
         def handler(request, response):
             return 202, [("test-header", "test-value")], "test data"
 
         route = ("GET", "/test/test_tuple_3_rv", handler)
         self.server.router.register(*route)
         resp = self.request(route[1])
         self.assertEqual(202, resp.getcode())
         self.assertEqual("test-value", resp.info()["test-header"])
-        self.assertEqual("test data", resp.read())
+        self.assertEqual(b"test data", resp.read())
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_tuple_3_rv_1(self):
         @wptserve.handlers.handler
         def handler(request, response):
             return (202, "Some Status"), [("test-header", "test-value")], "test data"
 
         route = ("GET", "/test/test_tuple_3_rv_1", handler)
         self.server.router.register(*route)
         resp = self.request(route[1])
         self.assertEqual(202, resp.getcode())
         self.assertEqual("Some Status", resp.msg)
         self.assertEqual("test-value", resp.info()["test-header"])
-        self.assertEqual("test data", resp.read())
+        self.assertEqual(b"test data", resp.read())
 
     def test_tuple_4_rv(self):
         @wptserve.handlers.handler
         def handler(request, response):
             return 202, [("test-header", "test-value")], "test data", "garbage"
 
         route = ("GET", "/test/test_tuple_1_rv", handler)
         self.server.router.register(*route)
@@ -255,27 +251,26 @@ class TestPythonHandler(TestUsingServer)
     def test_tuple_3(self):
         resp = self.request("/test_tuple_3.py")
         self.assertEqual(202, resp.getcode())
         self.assertEqual("Giraffe", resp.msg)
         self.assertEqual("text/html", resp.info()["Content-Type"])
         self.assertEqual("PASS", resp.info()["X-Test"])
         self.assertEqual(b"PASS", resp.read())
 
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_import(self):
         dir_name = os.path.join(doc_root, "subdir")
         assert dir_name not in sys.path
         assert "test_module" not in sys.modules
         resp = self.request("/subdir/import_handler.py")
         assert dir_name not in sys.path
         assert "test_module" not in sys.modules
         self.assertEqual(200, resp.getcode())
         self.assertEqual("text/plain", resp.info()["Content-Type"])
-        self.assertEqual("PASS", resp.read())
+        self.assertEqual(b"PASS", resp.read())
 
     def test_no_main(self):
         with pytest.raises(HTTPError) as cm:
             self.request("/no_main.py")
 
         assert cm.value.code == 500
 
     def test_invalid(self):
@@ -306,23 +301,22 @@ class TestDirectoryHandler(TestUsingServ
     def test_subdirectory_no_trailing_slash(self):
         # This seems to resolve the 301 transparently, so test for 200
         resp = self.request("/subdir")
         assert resp.getcode() == 200
         assert resp.info()["Content-Type"] == "text/html"
 
 
 class TestAsIsHandler(TestUsingServer):
-    @pytest.mark.xfail(sys.version_info >= (3,), reason="wptserve only works on Py2")
     def test_as_is(self):
         resp = self.request("/test.asis")
         self.assertEqual(202, resp.getcode())
         self.assertEqual("Giraffe", resp.msg)
         self.assertEqual("PASS", resp.info()["X-Test"])
-        self.assertEqual("Content", resp.read())
+        self.assertEqual(b"Content", resp.read())
         #Add a check that the response is actually sane
 
 
 class TestH2Handler(TestUsingH2Server):
     def test_handle_headers(self):
         self.conn.request("GET", '/test_h2_headers.py')
         resp = self.conn.get_response()