Use http.HTTPStatus in components/[ikl]* (#58248)

This commit is contained in:
Ville Skyttä 2021-10-23 00:06:18 +03:00 committed by GitHub
parent 1867d24b18
commit ce1eda9809
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 124 additions and 113 deletions

View file

@ -1,6 +1,7 @@
"""The tests for the InfluxDB component."""
from dataclasses import dataclass
import datetime
from http import HTTPStatus
from unittest.mock import MagicMock, Mock, call, patch
import pytest
@ -1640,14 +1641,16 @@ async def test_connection_failure_on_startup(
BASE_V1_CONFIG,
_get_write_api_mock_v1,
influxdb.DEFAULT_API_VERSION,
influxdb.exceptions.InfluxDBClientError("fail", code=400),
influxdb.exceptions.InfluxDBClientError(
"fail", code=HTTPStatus.BAD_REQUEST
),
),
(
influxdb.API_VERSION_2,
BASE_V2_CONFIG,
_get_write_api_mock_v2,
influxdb.API_VERSION_2,
influxdb.ApiException(status=400),
influxdb.ApiException(status=HTTPStatus.BAD_REQUEST),
),
],
indirect=["mock_client", "get_mock_call"],