Emoncms remove useless var in tests (#144942)

This commit is contained in:
Alexandre CUER 2025-05-15 09:48:01 +02:00 committed by GitHub
parent 9c4733595a
commit 7c306acd5d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,14 +7,7 @@ from unittest.mock import AsyncMock, patch
import pytest
from homeassistant.components.emoncms.const import CONF_ONLY_INCLUDE_FEEDID, DOMAIN
from homeassistant.const import (
CONF_API_KEY,
CONF_ID,
CONF_PLATFORM,
CONF_URL,
CONF_VALUE_TEMPLATE,
)
from homeassistant.helpers.typing import ConfigType
from homeassistant.const import CONF_API_KEY, CONF_URL
from tests.common import MockConfigEntry
@ -50,36 +43,6 @@ FLOW_RESULT = {
SENSOR_NAME = "emoncms@1.1.1.1"
YAML_BASE = {
CONF_PLATFORM: "emoncms",
CONF_API_KEY: "my_api_key",
CONF_ID: 1,
CONF_URL: "http://1.1.1.1",
}
YAML = {
**YAML_BASE,
CONF_ONLY_INCLUDE_FEEDID: [1],
}
@pytest.fixture
def emoncms_yaml_config() -> ConfigType:
"""Mock emoncms yaml configuration."""
return {"sensor": YAML}
@pytest.fixture
def emoncms_yaml_config_with_template() -> ConfigType:
"""Mock emoncms yaml conf with template parameter."""
return {"sensor": {**YAML, CONF_VALUE_TEMPLATE: "{{ value | float + 1500 }}"}}
@pytest.fixture
def emoncms_yaml_config_no_include_only_feed_id() -> ConfigType:
"""Mock emoncms yaml configuration without include_only_feed_id parameter."""
return {"sensor": YAML_BASE}
@pytest.fixture
def config_entry() -> MockConfigEntry: