hass-core/tests/components/bmw_connected_drive/conftest.py
rikroe 565f311f5c
Add EV charging remote services for BMW/Mini (#88759)
* Add select for EV charging to bmw_connected_drive

* Use snapshot for select tests, split select_option tests

* Apply suggestions from code review

Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>

* Further adjustments from code review

---------

Co-authored-by: rikroe <rikroe@users.noreply.github.com>
Co-authored-by: epenet <6771947+epenet@users.noreply.github.com>
2023-03-30 19:37:03 +02:00

24 lines
680 B
Python

"""Fixtures for BMW tests."""
from unittest.mock import AsyncMock
from bimmer_connected.api.authentication import MyBMWAuthentication
from bimmer_connected.vehicle.remote_services import RemoteServices, RemoteServiceStatus
import pytest
from . import mock_login, mock_vehicles
@pytest.fixture
async def bmw_fixture(monkeypatch):
"""Patch the MyBMW Login and mock HTTP calls."""
monkeypatch.setattr(MyBMWAuthentication, "login", mock_login)
monkeypatch.setattr(
RemoteServices,
"trigger_remote_service",
AsyncMock(return_value=RemoteServiceStatus({"eventStatus": "EXECUTED"})),
)
with mock_vehicles():
yield mock_vehicles