Python 3: port some tests in common and infrastructure (#24482)
diff --git a/common/echo.py b/common/echo.py
index 2ee4036..911b54a 100644
--- a/common/echo.py
+++ b/common/echo.py
@@ -1,6 +1,6 @@
def main(request, response):
# Without X-XSS-Protection to disable non-standard XSS protection the functionality this
# resource offers is useless
- response.headers.set("X-XSS-Protection", "0")
- response.headers.set("Content-Type", "text/html")
- response.content = request.GET.first("content")
+ response.headers.set(b"X-XSS-Protection", b"0")
+ response.headers.set(b"Content-Type", b"text/html")
+ response.content = request.GET.first(b"content")
diff --git a/common/slow.py b/common/slow.py
index f3b1c7e..5329a04 100644
--- a/common/slow.py
+++ b/common/slow.py
@@ -2,4 +2,4 @@
def main(request, response):
time.sleep(2)
- return 200, [], ''
+ return 200, [], b''
diff --git a/infrastructure/testdriver/file_upload.py b/infrastructure/testdriver/file_upload.py
index 89ed67a..9c4dd75 100644
--- a/infrastructure/testdriver/file_upload.py
+++ b/infrastructure/testdriver/file_upload.py
@@ -1,2 +1,2 @@
def main(request, response):
- return "PASS" if request.POST[b"file_input"].file.read() == b"File to upload\n" else "FAIL"
+ return b"PASS" if request.POST[b"file_input"].file.read() == b"File to upload\n" else b"FAIL"