mirror of
https://github.com/home-assistant/core.git
synced 2025-11-10 11:29:46 +00:00
Refactor frame.get_integration_frame (#101322)
This commit is contained in:
@@ -1515,33 +1515,6 @@ async def recorder_mock(
|
||||
return await async_setup_recorder_instance(hass, recorder_config)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def mock_integration_frame() -> Generator[Mock, None, None]:
|
||||
"""Mock as if we're calling code from inside an integration."""
|
||||
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()",
|
||||
),
|
||||
],
|
||||
):
|
||||
yield correct_frame
|
||||
|
||||
|
||||
@pytest.fixture(name="enable_bluetooth")
|
||||
async def mock_enable_bluetooth(
|
||||
hass: HomeAssistant,
|
||||
|
||||
Reference in New Issue
Block a user