hass-core/tests/components/motion_blinds/test_gateway.py
starkillerOG 6cadd4f665
MotionBlinds use device_name helper (#72438)
* use device_name helper

* fix typo

* fix import

* fix isort

* add gateway_test

* implement gateway test

* correct test blind mac
2022-06-03 15:33:43 +02:00

19 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"