Use http.HTTPStatus in components/[ikl]* (#58248)
This commit is contained in:
parent
1867d24b18
commit
ce1eda9809
17 changed files with 124 additions and 113 deletions
|
@ -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"],
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue