devtools/httptest.py
changeset 10604 d4bf85db41f2
parent 10603 65ad6980976e
child 10609 e2d8e81bfe68
--- a/devtools/httptest.py	Tue Sep 22 09:39:30 2015 +0200
+++ b/devtools/httptest.py	Mon Sep 14 12:40:57 2015 +0200
@@ -25,8 +25,8 @@
 import random
 import threading
 import socket
-import httplib
 
+from six.moves import http_client
 from six.moves.urllib.parse import urlparse
 
 from twisted.internet import reactor, error
@@ -113,8 +113,8 @@
         #pre init utils connection
         parseurl = urlparse(self.config['base-url'])
         assert parseurl.port == self.config['port'], (self.config['base-url'], self.config['port'])
-        self._web_test_cnx = httplib.HTTPConnection(parseurl.hostname,
-                                                    parseurl.port)
+        self._web_test_cnx = http_client.HTTPConnection(parseurl.hostname,
+                                                        parseurl.port)
         self._ident_cookie = None
 
     def stop_server(self, timeout=15):
@@ -142,7 +142,7 @@
             passwd = user
         response = self.web_get("login?__login=%s&__password=%s" %
                                 (user, passwd))
-        assert response.status == httplib.SEE_OTHER, response.status
+        assert response.status == http_client.SEE_OTHER, response.status
         self._ident_cookie = response.getheader('Set-Cookie')
         assert self._ident_cookie
         return True
@@ -154,7 +154,7 @@
         self._ident_cookie = None
 
     def web_request(self, path='', method='GET', body=None, headers=None):
-        """Return an httplib.HTTPResponse object for the specified path
+        """Return an http_client.HTTPResponse object for the specified path
 
         Use available credential if available.
         """