-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2c45215
commit 67f2437
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) |