mirror of
https://github.com/home-assistant/core.git
synced 2025-05-06 23:19:18 +00:00

* use device_name helper * fix typo * fix import * fix isort * add gateway_test * implement gateway test * correct test blind mac
20 lines
546 B
Python
20 lines
546 B
Python
"""Test the Motion Blinds config flow."""
|
|
from unittest.mock import Mock
|
|
|
|
from motionblinds import DEVICE_TYPES_WIFI, BlindType
|
|
|
|
from homeassistant.components.motion_blinds.gateway import device_name
|
|
|
|
TEST_BLIND_MAC = "abcdefghujkl0001"
|
|
|
|
|
|
async def test_device_name(hass):
|
|
"""test_device_name."""
|
|
blind = Mock()
|
|
blind.blind_type = BlindType.RollerBlind.name
|
|
blind.mac = TEST_BLIND_MAC
|
|
assert device_name(blind) == "RollerBlind 0001"
|
|
|
|
blind.device_type = DEVICE_TYPES_WIFI[0]
|
|
assert device_name(blind) == "RollerBlind"
|