Convert tests to Python 3

Fix #938
This commit is contained in:
Lorenzo Bolla
2022-01-27 11:35:35 +01:00
parent a40cfc679c
commit 035d5314b0
27 changed files with 241 additions and 284 deletions
+3 -3
View File
@@ -2,7 +2,7 @@
Testing serving public repo
"""
import httplib
import http.client
import os
import signal
import subprocess
@@ -50,7 +50,7 @@ class Serve1Test(BaseTest):
try:
time.sleep(1)
conn = httplib.HTTPConnection("127.0.0.1", 8765)
conn = http.client.HTTPConnection("127.0.0.1", 8765)
conn.request("GET", "/")
r = conn.getresponse()
if r.status != 200:
@@ -66,7 +66,7 @@ class Serve1Test(BaseTest):
if proc.returncode != -2 and proc.returncode != 2:
raise Exception("exit code %d != %d (output: %s)" % (proc.returncode, -2, output))
self.output = output
except Exception, e:
except Exception as e:
raise Exception("Running command %s failed: %s" % (self.runCmd, str(e)))
def check(self):