* Adding tests for vera component. Fixing update bug in the vera climate platform. * Updating requrements file. * Moving vera stop to a job. Sorting imports. * Addressing simple PR feedback. * Splitting tests into platforms. * Mocking controller instead of using requests_mock. * Updating pyvera to use version that stops threads quickly. * Updating requirements files. * Mocking the pyvera module, not the API. * Addressing PR feedback. Handling start/stop of patch in fixture. Removing unecessary code. * Using generator
13 lines
335 B
Python
13 lines
335 B
Python
"""Fixtures for tests."""
|
|
|
|
from mock import patch
|
|
import pytest
|
|
|
|
from .common import ComponentFactory
|
|
|
|
|
|
@pytest.fixture()
|
|
def vera_component_factory():
|
|
"""Return a factory for initializing the vera component."""
|
|
with patch("pyvera.init_controller") as init_controller_mock:
|
|
yield ComponentFactory(init_controller_mock)
|