Use http.HTTPStatus in components/[gh]* (#58246)

This commit is contained in:
Ville Skyttä 2021-10-23 21:34:53 +03:00 committed by GitHub
parent 583ae3c953
commit b52c5c82b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
38 changed files with 272 additions and 247 deletions

View file

@ -1,4 +1,6 @@
"""The tests for google-assistant init."""
from http import HTTPStatus
from homeassistant.components import google_assistant as ga
from homeassistant.core import Context
from homeassistant.setup import async_setup_component
@ -10,11 +12,11 @@ async def test_request_sync_service(aioclient_mock, hass):
"""Test that it posts to the request_sync url."""
aioclient_mock.post(
ga.const.HOMEGRAPH_TOKEN_URL,
status=200,
status=HTTPStatus.OK,
json={"access_token": "1234", "expires_in": 3600},
)
aioclient_mock.post(ga.const.REQUEST_SYNC_BASE_URL, status=200)
aioclient_mock.post(ga.const.REQUEST_SYNC_BASE_URL, status=HTTPStatus.OK)
await async_setup_component(
hass,