Skip to content

Commit

Permalink
Add test for devices
Browse files Browse the repository at this point in the history
  • Loading branch information
natekspencer committed Mar 4, 2024
1 parent 00a0b5a commit 3141767
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
9 changes: 9 additions & 0 deletions tests/test_devices.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion vivintpy/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3141767

Please sign in to comment.