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 Google Pub/Sub component."""
from collections import namedtuple
from dataclasses import dataclass
from datetime import datetime
import pytest
@@ -15,6 +15,14 @@ import tests.async_mock as mock
GOOGLE_PUBSUB_PATH = "homeassistant.components.google_pubsub"
@dataclass
class FilterTest:
"""Class for capturing a filter test."""
id: str
should_pass: bool
async def test_datetime():
"""Test datetime encoding."""
time = datetime(2019, 1, 13, 12, 30, 5)
@@ -109,9 +117,6 @@ async def test_full_config(hass, mock_client):
)
FilterTest = namedtuple("FilterTest", "id should_pass")
def make_event(entity_id):
"""Make a mock event for test."""
domain = split_entity_id(entity_id)[0]