Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 23fa84e

Browse files
Verify that Ecovacs integration is setup without any errors in the tests (home-assistant#152447)
1 parent 7f13141 commit 23fa84e

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

‎tests/components/ecovacs/conftest.py‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Common fixtures for the Ecovacs tests."""
22

33
from collections.abc import AsyncGenerator, Generator
4+
import logging
45
from typing import Any
56
from unittest.mock import AsyncMock, Mock, patch
67

@@ -134,6 +135,7 @@ def mock_vacbot(device_fixture: str) -> Generator[Mock]:
134135
vacbot.lifespanEvents = EventEmitter()
135136
vacbot.errorEvents = EventEmitter()
136137
vacbot.battery_status = None
138+
vacbot.charge_status = None
137139
vacbot.fan_speed = None
138140
vacbot.components = {}
139141
yield vacbot
@@ -159,6 +161,7 @@ def platforms() -> Platform | list[Platform]:
159161
@pytest.fixture
160162
async def init_integration(
161163
hass: HomeAssistant,
164+
caplog: pytest.LogCaptureFixture,
162165
mock_config_entry: MockConfigEntry,
163166
mock_authenticator: Mock,
164167
mock_mqtt_client: Mock,
@@ -177,6 +180,12 @@ async def init_integration(
177180

178181
await hass.config_entries.async_setup(mock_config_entry.entry_id)
179182
await hass.async_block_till_done(wait_background_tasks=True)
183+
184+
# No errors should be logged during setup
185+
assert not [t for t in caplog.record_tuples if t[1] >= logging.ERROR], (
186+
"Errors during integration setup"
187+
)
188+
180189
yield mock_config_entry
181190

182191

‎tests/components/ecovacs/test_init.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ async def test_devices_in_dr(
107107
[
108108
("yna5x1", 26),
109109
("5xu9h3", 25),
110-
("123", 2),
110+
("123", 3),
111111
],
112112
)
113113
async def test_all_entities_loaded(

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /