Changed FilterTest namedtuples to dataclasses (#37252)

This commit is contained in:
mdegat01 authored and GitHub committed 2020-06-30 11:59:21 -05:00
1 parent 86c27b50f1
commit b78f163bb0
4 files changed
+47 -13

No files matched your search

+9 -4
View File
@@ -1,5 +1,5 @@
"""The tests for the Prometheus exporter."""
from collections import namedtuple
from dataclasses import dataclass
import pytest
@@ -22,6 +22,14 @@ import tests.async_mock as mock
PROMETHEUS_PATH = "homeassistant.components.prometheus"
@dataclass
class FilterTest:
"""Class for capturing a filter test."""
id: str
should_pass: bool
@pytest.fixture
async def prometheus_client(loop, hass, hass_client):
"""Initialize an hass_client with Prometheus component."""
@@ -202,9 +210,6 @@ async def test_full_config(hass, mock_client):
assert EVENT_STATE_CHANGED == hass.bus.listen.call_args_list[0][0][0]
FilterTest = namedtuple("FilterTest", "id should_pass")
def make_event(entity_id):
"""Make a mock event for test."""
domain = split_entity_id(entity_id)[0]