summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-06-22 01:04:49 +0000
committerGerrit Code Review <review@openstack.org>2013-06-22 01:04:49 +0000
commit76750f3dcce19098c9fb9793db1fe0c40411f7af (patch)
tree4b490bcba7e8bf52b7568fb3e2412b8e555c7e97
parent1b46e583c3eefccdfe1102fa068611b8e0f004f5 (diff)
parent346d9419a6aeb3c1277fa0ad2c539045be571d30 (diff)
downloadnova-76750f3dcce19098c9fb9793db1fe0c40411f7af.tar.gz
nova-76750f3dcce19098c9fb9793db1fe0c40411f7af.tar.xz
nova-76750f3dcce19098c9fb9793db1fe0c40411f7af.zip
Merge "Port missing bits from httplib2 to requests"
-rw-r--r--nova/tests/test_cinder.py5
-rw-r--r--nova/tests/test_wsgi.py15
-rw-r--r--requirements.txt1
3 files changed, 9 insertions, 12 deletions
diff --git a/nova/tests/test_cinder.py b/nova/tests/test_cinder.py
index e8dff9a4a..98cc1c3f9 100644
--- a/nova/tests/test_cinder.py
+++ b/nova/tests/test_cinder.py
@@ -14,7 +14,6 @@
# License for the specific language governing permissions and limitations
# under the License.
-import httplib2
import urlparse
from cinderclient import exceptions as cinder_exception
@@ -76,9 +75,9 @@ class FakeHTTPClient(cinder.cinder_client.client.HTTPClient):
status, body = getattr(self, callback)(**kwargs)
if hasattr(status, 'items'):
- return httplib2.Response(status), body
+ return status, body
else:
- return httplib2.Response({"status": status}), body
+ return {"status": status}, body
def get_volumes_1234(self, **kw):
volume = {'volume': _stub_volume(id='1234')}
diff --git a/nova/tests/test_wsgi.py b/nova/tests/test_wsgi.py
index d1d659fe3..7118aa938 100644
--- a/nova/tests/test_wsgi.py
+++ b/nova/tests/test_wsgi.py
@@ -23,8 +23,7 @@ import tempfile
import testtools
import eventlet
-import httplib2
-import paste
+import requests
import nova.exception
from nova import test
@@ -119,16 +118,16 @@ class TestWSGIServer(test.TestCase):
server.start()
uri = "http://127.0.0.1:%d/%s" % (server.port, 10000 * 'x')
- resp, _ = httplib2.Http().request(uri)
+ resp = requests.get(uri)
eventlet.sleep(0)
- self.assertNotEqual(resp.status,
- paste.httpexceptions.HTTPRequestURITooLong.code)
+ self.assertNotEqual(resp.status_code,
+ requests.codes.REQUEST_URI_TOO_LARGE)
uri = "http://127.0.0.1:%d/%s" % (server.port, 20000 * 'x')
- resp, _ = httplib2.Http().request(uri)
+ resp = requests.get(uri)
eventlet.sleep(0)
- self.assertEqual(resp.status,
- paste.httpexceptions.HTTPRequestURITooLong.code)
+ self.assertEqual(resp.status_code,
+ requests.codes.REQUEST_URI_TOO_LARGE)
server.stop()
server.wait()
diff --git a/requirements.txt b/requirements.txt
index ce8cd716f..68cec7c31 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -21,7 +21,6 @@ paramiko
pyasn1
Babel>=0.9.6
iso8601>=0.1.4
-httplib2
requests>=1.1,<1.2.1 # order-dependent python-cinderclient req cap, bug 1182271
python-cinderclient>=1.0.1
python-quantumclient>=2.2.0,<3.0.0