Fix tempest test for empty_body
Depending on the actual server in which monasca-log-api
is running, the error code for empty body may differ.
For example, for mod_wsgi the error code is 411,
but, on the other hand, gunicorn (devstack's setup)
returns 422. Since the actual error code is not that important,
simply accept all of them.
Change-Id: I6ab160148863f38b08172eee430ebce4c3e9e04d
(cherry picked from commit 8395231400
)
This commit is contained in:
parent
20ed6513ee
commit
f52802f00c
|
@ -26,10 +26,12 @@ class TestLogApiConstraints(base.BaseLogsTestCase):
|
|||
try:
|
||||
cli.custom_request('POST', headers, None)
|
||||
except exceptions.UnprocessableEntity as urc:
|
||||
self.assertEqual(422, urc.resp.status)
|
||||
# depending on the actual server (for example gunicorn vs mod_wsgi)
|
||||
# monasca-log-api may return a different error code
|
||||
self.assertTrue(urc.resp.status in [411, 422])
|
||||
return
|
||||
|
||||
self.assertTrue(False, 'API should respond with 411')
|
||||
self.assertTrue(False, 'API should respond with an error')
|
||||
|
||||
@test.attr(type='gate')
|
||||
def test_should_reject_if_content_type_missing(self):
|
||||
|
|
Loading…
Reference in New Issue