Stop trying to set a body for HTTP methods that do not allow it. It renders the unit tests useless (since they're testing a situation that can never arise) and webob 1.0.8 fails if you do this.
This commit is contained in:
commit
7cb4d3150b
@ -672,8 +672,7 @@ class WsgiLimiterTest(BaseLimitTestSuite):
|
|||||||
"""Only POSTs should work."""
|
"""Only POSTs should work."""
|
||||||
requests = []
|
requests = []
|
||||||
for method in ["GET", "PUT", "DELETE", "HEAD", "OPTIONS"]:
|
for method in ["GET", "PUT", "DELETE", "HEAD", "OPTIONS"]:
|
||||||
request = webob.Request.blank("/")
|
request = webob.Request.blank("/", method=method)
|
||||||
request.body = self._request_data("GET", "/something")
|
|
||||||
response = request.get_response(self.app)
|
response = request.get_response(self.app)
|
||||||
self.assertEqual(response.status_int, 405)
|
self.assertEqual(response.status_int, 405)
|
||||||
|
|
||||||
|
@ -1502,7 +1502,7 @@ class ServersTest(test.TestCase):
|
|||||||
self.assertEqual(res.status_int, 400)
|
self.assertEqual(res.status_int, 400)
|
||||||
|
|
||||||
def test_resized_server_has_correct_status(self):
|
def test_resized_server_has_correct_status(self):
|
||||||
req = self.webreq('/1', 'GET', dict(resize=dict(flavorId=3)))
|
req = self.webreq('/1', 'GET')
|
||||||
|
|
||||||
def fake_migration_get(*args):
|
def fake_migration_get(*args):
|
||||||
return {}
|
return {}
|
||||||
|
@ -10,13 +10,13 @@ from nova.api.openstack import wsgi
|
|||||||
|
|
||||||
class RequestTest(test.TestCase):
|
class RequestTest(test.TestCase):
|
||||||
def test_content_type_missing(self):
|
def test_content_type_missing(self):
|
||||||
request = wsgi.Request.blank('/tests/123')
|
request = wsgi.Request.blank('/tests/123', method='POST')
|
||||||
request.body = "<body />"
|
request.body = "<body />"
|
||||||
self.assertRaises(exception.InvalidContentType,
|
self.assertRaises(exception.InvalidContentType,
|
||||||
request.get_content_type)
|
request.get_content_type)
|
||||||
|
|
||||||
def test_content_type_unsupported(self):
|
def test_content_type_unsupported(self):
|
||||||
request = wsgi.Request.blank('/tests/123')
|
request = wsgi.Request.blank('/tests/123', method='POST')
|
||||||
request.headers["Content-Type"] = "text/html"
|
request.headers["Content-Type"] = "text/html"
|
||||||
request.body = "asdf<br />"
|
request.body = "asdf<br />"
|
||||||
self.assertRaises(exception.InvalidContentType,
|
self.assertRaises(exception.InvalidContentType,
|
||||||
|
@ -15,7 +15,7 @@ python-daemon==1.5.5
|
|||||||
python-gflags==1.3
|
python-gflags==1.3
|
||||||
redis==2.0.0
|
redis==2.0.0
|
||||||
routes==1.12.3
|
routes==1.12.3
|
||||||
WebOb==0.9.8
|
WebOb==1.0.8
|
||||||
wsgiref==0.1.2
|
wsgiref==0.1.2
|
||||||
mox==0.5.3
|
mox==0.5.3
|
||||||
greenlet==0.3.1
|
greenlet==0.3.1
|
||||||
|
Loading…
Reference in New Issue
Block a user