Add API scope checks to Teslemetry (#113640)

This commit is contained in:
Brett Adams 2024-04-24 06:11:41 +10:00 committed by GitHub
parent a33aacfcaa
commit f249a9ba4b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 99 additions and 8 deletions

View file

@ -7,7 +7,23 @@ from unittest.mock import patch
import pytest
from .const import LIVE_STATUS, PRODUCTS, RESPONSE_OK, VEHICLE_DATA, WAKE_UP_ONLINE
from .const import (
LIVE_STATUS,
METADATA,
PRODUCTS,
RESPONSE_OK,
VEHICLE_DATA,
WAKE_UP_ONLINE,
)
@pytest.fixture(autouse=True)
def mock_metadata():
"""Mock Tesla Fleet Api metadata method."""
with patch(
"homeassistant.components.teslemetry.Teslemetry.metadata", return_value=METADATA
) as mock_products:
yield mock_products
@pytest.fixture(autouse=True)