Merge "Port missing bits from httplib2 to requests"
This commit is contained in:
@@ -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')}
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user