Skip to content

Commit

Permalink
Add test for command data
Browse files Browse the repository at this point in the history
  • Loading branch information
rrooggiieerr committed Jun 26, 2024
1 parent 2c45215 commit 67f2437
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions tests/test_unii_command_data.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# pylint: disable=R0801
# pylint: disable=missing-function-docstring
"""
Test UNii Command Data helper functions.
"""

import logging
import unittest

from unii.unii_command_data import UNiiBypassMode, UNiiBypassUnbypassZoneInput

_LOGGER = logging.getLogger(__name__)


class Test(unittest.TestCase):
"""
Test UNii Command Data helper function correctness.
"""

def test_bypass_input(self):
data = UNiiBypassUnbypassZoneInput(UNiiBypassMode.USER_CODE, "123456", 1)
self.assertEqual(data.mode, 0)
self.assertEqual(data.code, "12345600")
self.assertEqual(data.number, 1)
self.assertEqual(data.to_bytes(), bytes.fromhex("0012345600000000000001"))

0 comments on commit 67f2437

Please sign in to comment.