mirror of
https://github.com/home-assistant/core.git
synced 2025-11-08 18:39:30 +00:00
Do not use AsyncTrackStates (#47255)
This commit is contained in:
@@ -6,34 +6,13 @@ import pytest
|
||||
from homeassistant.helpers import frame
|
||||
|
||||
|
||||
async def test_extract_frame_integration(caplog):
|
||||
async def test_extract_frame_integration(caplog, mock_integration_frame):
|
||||
"""Test extracting the current frame from integration context."""
|
||||
correct_frame = Mock(
|
||||
filename="/home/paulus/homeassistant/components/hue/light.py",
|
||||
lineno="23",
|
||||
line="self.light.is_on",
|
||||
)
|
||||
with patch(
|
||||
"homeassistant.helpers.frame.extract_stack",
|
||||
return_value=[
|
||||
Mock(
|
||||
filename="/home/paulus/homeassistant/core.py",
|
||||
lineno="23",
|
||||
line="do_something()",
|
||||
),
|
||||
correct_frame,
|
||||
Mock(
|
||||
filename="/home/paulus/aiohue/lights.py",
|
||||
lineno="2",
|
||||
line="something()",
|
||||
),
|
||||
],
|
||||
):
|
||||
found_frame, integration, path = frame.get_integration_frame()
|
||||
found_frame, integration, path = frame.get_integration_frame()
|
||||
|
||||
assert integration == "hue"
|
||||
assert path == "homeassistant/components/"
|
||||
assert found_frame == correct_frame
|
||||
assert found_frame == mock_integration_frame
|
||||
|
||||
|
||||
async def test_extract_frame_integration_with_excluded_intergration(caplog):
|
||||
|
||||
Reference in New Issue
Block a user