From 3141767c852d363087449fb4a409fe1a40000fd2 Mon Sep 17 00:00:00 2001 From: Nathan Spencer Date: Mon, 4 Mar 2024 11:53:32 -0700 Subject: [PATCH] Add test for devices --- tests/test_devices.py | 9 +++++++++ vivintpy/devices/__init__.py | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 tests/test_devices.py diff --git a/tests/test_devices.py b/tests/test_devices.py new file mode 100644 index 0000000..2b6a740 --- /dev/null +++ b/tests/test_devices.py @@ -0,0 +1,9 @@ +"""Test the devices.""" +from vivintpy.devices import get_device_class +from vivintpy.devices.switch import BinarySwitch +from vivintpy.enums import DeviceType + + +def test_get_device_class() -> None: + """Test get device class.""" + assert get_device_class(DeviceType.BINARY_SWITCH.value) == BinarySwitch diff --git a/vivintpy/devices/__init__.py b/vivintpy/devices/__init__.py index 2e9b574..e1d0405 100644 --- a/vivintpy/devices/__init__.py +++ b/vivintpy/devices/__init__.py @@ -24,7 +24,7 @@ def get_device_class(device_type: str) -> Type[VivintDevice]: """Map a device_type string to the class that implements that device.""" - # pylint: disable=import-outside-toplevel + # pylint: disable=import-outside-toplevel,cyclic-import from .camera import Camera from .door_lock import DoorLock from .garage_door import GarageDoor