use HTTPStatus instead of direct code

Python introduced http.HTTPStatus since version 3.5,
and Wallaby has targeted a minimum version of python 3.6.

Change-Id: I45f732f0f59b8fae831bb6c07f4fdd98cdd7409a
This commit is contained in:
sue
2021-03-25 15:49:10 +08:00
committed by Dantali0n
parent 546b730c9b
commit c28756c48b
25 changed files with 215 additions and 177 deletions

View File

@@ -13,6 +13,8 @@
# License for the specific language governing permissions and limitations
# under the License.
from http import HTTPStatus
from watcher.tests.api import base
@@ -25,6 +27,6 @@ class TestBase(base.FunctionalTest):
response = self.get_json('/bad/path',
expect_errors=True,
headers={"Accept": "application/json"})
self.assertEqual(404, response.status_int)
self.assertEqual(HTTPStatus.NOT_FOUND, response.status_int)
self.assertEqual("application/json", response.content_type)
self.assertTrue(response.json['error_message'])