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
+4 -2
View File
@@ -1,7 +1,9 @@
import requests_unixsocket
import time
import os
import urllib
import urllib.error
import urllib.parse
import urllib.request
from lib import BaseTest
@@ -32,7 +34,7 @@ class UnixSocketAPITest(BaseTest):
"""
def check(self):
session = requests_unixsocket.Session()
r = session.get('http+unix://%s/api/version' % urllib.quote(UnixSocketAPITest.socket_path, safe=''))
r = session.get('http+unix://%s/api/version' % urllib.parse.quote(UnixSocketAPITest.socket_path, safe=''))
# Just needs to come back, we actually don't care much about the code.
# Only needs to verify that the socket is actually responding.
self.check_equal(r.json(), {'Version': os.environ['APTLY_VERSION']})