mirror of
https://github.com/esphome/esphome.git
synced 2026-06-24 13:27:14 +00:00
[mipi_spi] Run spi final validation (#15418)
Co-authored-by: Jonathan Swoboda <154711427+swoboda1337@users.noreply.github.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
"""Tests for mpip_spi configuration validation."""
|
||||
|
||||
from collections.abc import Callable, Generator
|
||||
from unittest import mock
|
||||
|
||||
import pytest
|
||||
|
||||
@@ -12,6 +13,16 @@ from esphome.core import CORE
|
||||
from esphome.pins import gpio_pin_schema
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def mock_spi_final_validate():
|
||||
"""Mock spi.final_validate_device_schema since unit tests have no real SPI bus config."""
|
||||
with mock.patch(
|
||||
"esphome.components.spi.final_validate_device_schema",
|
||||
return_value=lambda config: None,
|
||||
):
|
||||
yield
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def choose_variant_with_pins() -> Generator[Callable[[list], None]]:
|
||||
"""
|
||||
|
||||
@@ -25,7 +25,9 @@ from tests.component_tests.types import SetCoreConfigCallable
|
||||
|
||||
def validated_config(config):
|
||||
"""Run schema + final validation and return the validated config."""
|
||||
return FINAL_VALIDATE_SCHEMA(CONFIG_SCHEMA(config))
|
||||
config = CONFIG_SCHEMA(config)
|
||||
FINAL_VALIDATE_SCHEMA(config)
|
||||
return config
|
||||
|
||||
|
||||
def test_metadata_native_quad_default_test_card(
|
||||
|
||||
Reference in New Issue
Block a user