From 83952314007122d9afb1898ce0193567ee70edb4 Mon Sep 17 00:00:00 2001 From: wachowskij Date: Wed, 28 Jun 2017 12:16:05 +0200 Subject: [PATCH] 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 --- monasca_log_api_tempest/tests/log_api/test_constraints.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/monasca_log_api_tempest/tests/log_api/test_constraints.py b/monasca_log_api_tempest/tests/log_api/test_constraints.py index d53487f4..7b9bfcbd 100644 --- a/monasca_log_api_tempest/tests/log_api/test_constraints.py +++ b/monasca_log_api_tempest/tests/log_api/test_constraints.py @@ -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') @decorators.attr(type='gate') def test_should_reject_if_content_type_missing(self):