Skip to content

Commit 008bb85

Browse files
authored
Mock arguments in senz tests (home-assistant#156677)
1 parent cf1c129 commit 008bb85

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

tests/components/senz/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from collections.abc import Generator
44
import time
55
from typing import Any
6-
from unittest.mock import MagicMock, patch
6+
from unittest.mock import MagicMock, Mock, patch
77

88
from aiosenz import Account, Thermostat
99
import pytest
@@ -92,7 +92,7 @@ def mock_senz_client(account_fixture, device_fixture) -> Generator[MagicMock]:
9292

9393
client.get_account.return_value = Account(account_fixture)
9494
client.get_thermostats.return_value = [
95-
Thermostat(device, None) for device in device_fixture
95+
Thermostat(device, Mock()) for device in device_fixture
9696
]
9797

9898
yield client

tests/components/senz/test_init.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from http import HTTPStatus
44
import time
5-
from unittest.mock import MagicMock, patch
5+
from unittest.mock import MagicMock, Mock, patch
66

77
from aiosenz import TOKEN_ENDPOINT
88
from httpx import HTTPStatusError, RequestError
@@ -129,15 +129,15 @@ async def test_expired_token_refresh_failure(
129129
(
130130
HTTPStatusError(
131131
message="Exception",
132-
request=None,
132+
request=Mock(),
133133
response=MagicMock(status_code=HTTPStatus.UNAUTHORIZED),
134134
),
135135
ConfigEntryState.SETUP_ERROR,
136136
),
137137
(
138138
HTTPStatusError(
139139
message="Exception",
140-
request=None,
140+
request=Mock(),
141141
response=MagicMock(status_code=HTTPStatus.FORBIDDEN),
142142
),
143143
ConfigEntryState.SETUP_RETRY,

0 commit comments

Comments
 (0)