summaryrefslogtreecommitdiffstats
path: root/ipatests
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-09-14 12:52:29 +0200
committerJan Cholasta <jcholast@redhat.com>2015-10-07 10:27:20 +0200
commit70b37a956c0b7dad52bf14fdb5fed421c01c8f77 (patch)
tree76768609fdbca12ccc93b092e14c4fc4ae06459a /ipatests
parent7f1204a42c0fd13602768e24da7af8814cbf97d2 (diff)
downloadfreeipa-70b37a956c0b7dad52bf14fdb5fed421c01c8f77.tar.gz
freeipa-70b37a956c0b7dad52bf14fdb5fed421c01c8f77.tar.xz
freeipa-70b37a956c0b7dad52bf14fdb5fed421c01c8f77.zip
Use six.moves.urllib instead of urllib/urllib2/urlparse
In Python 3, these modules are reorganized. Reviewed-By: David Kupka <dkupka@redhat.com> Reviewed-By: Jan Cholasta <jcholast@redhat.com> Reviewed-By: Martin Basti <mbasti@redhat.com>
Diffstat (limited to 'ipatests')
-rw-r--r--ipatests/test_ipaserver/httptest.py7
-rw-r--r--ipatests/test_webui/ui_driver.py2
2 files changed, 6 insertions, 3 deletions
diff --git a/ipatests/test_ipaserver/httptest.py b/ipatests/test_ipaserver/httptest.py
index 7f1b5b136..891364c06 100644
--- a/ipatests/test_ipaserver/httptest.py
+++ b/ipatests/test_ipaserver/httptest.py
@@ -20,9 +20,10 @@
Base class for HTTP request tests
"""
-import urllib
import httplib
+from six.moves import urllib
+
from ipalib import api
class Unauthorized_HTTP_test(object):
@@ -41,7 +42,9 @@ class Unauthorized_HTTP_test(object):
:param key When not None, overrides default app_uri
"""
if params is not None:
- params = urllib.urlencode(params, True)
+ # urlencode *can* take two arguments
+ # pylint: disable=too-many-function-args
+ params = urllib.parse.urlencode(params, True)
url = 'https://' + self.host + self.app_uri
headers = {'Content-Type' : self.content_type,
diff --git a/ipatests/test_webui/ui_driver.py b/ipatests/test_webui/ui_driver.py
index 6f2013c4a..fc22f8612 100644
--- a/ipatests/test_webui/ui_driver.py
+++ b/ipatests/test_webui/ui_driver.py
@@ -53,7 +53,7 @@ try:
NO_YAML = False
except ImportError:
NO_YAML = True
-from urllib2 import URLError
+from six.moves.urllib.error import URLError
from ipaplatform.paths import paths
ENV_MAP = {