Checks / tests (ubuntu-latest, 3.11) (push) Canceled after 0s
Checks / tests (ubuntu-latest, 3.14) (push) Canceled after 0s
Checks / tests (windows-latest, 3.11) (push) Canceled after 0s
Checks / tests (windows-latest, 3.14) (push) Canceled after 0s
Checks / package (push) Canceled after 0s
22 lines
733 B
Python
22 lines
733 B
Python
"""Decode actual status payloads without constructing a Tk window."""
|
|
|
|
import unittest
|
|
|
|
from controller.messages import describe_reply
|
|
|
|
|
|
class StatusTests(unittest.TestCase):
|
|
def test_captured_standard_eq(self):
|
|
self.assertEqual(describe_reply(bytes.fromhex("41 03 02 00")), "EQ: Standard")
|
|
|
|
def test_captured_volume_mute_and_lighting(self):
|
|
for raw, expected in [
|
|
("41 01 0b 00", "Volume: 11"),
|
|
("41 01 0c 00", "Volume: 12"),
|
|
("41 07 01 00", "Mute: On"),
|
|
("41 07 02 00", "Mute: Off"),
|
|
("51 03 03", "Lighting: Dance"),
|
|
]:
|
|
with self.subTest(raw=raw):
|
|
self.assertEqual(describe_reply(bytes.fromhex(raw)), expected)
|