File: frame_get_node_information_req_test.py

package info (click to toggle)
pyvlx 0.2.27-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,548 kB
  • sloc: python: 7,914; makefile: 39; sh: 5
file content (27 lines) | stat: -rw-r--r-- 1,108 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
"""Unit tests for FrameGetNodeInformationRequest."""
import unittest

from pyvlx.api.frame_creation import frame_from_raw
from pyvlx.api.frames import FrameGetNodeInformationRequest


class TestFrameGetNodeInformationRequest(unittest.TestCase):
    """Test class for FrameGetNodeInformationRequest."""

    # pylint: disable=too-many-public-methods,invalid-name

    def test_bytes(self):
        """Test FrameGetNodeInformationRequest with NO_TYPE."""
        frame = FrameGetNodeInformationRequest(node_id=23)
        self.assertEqual(bytes(frame), b"\x00\x04\x02\x00\x17\x11")

    def test_frame_from_raw(self):
        """Test parse FrameGetNodeInformationRequest from raw."""
        frame = frame_from_raw(b"\x00\x04\x02\x00\x17\x11")
        self.assertTrue(isinstance(frame, FrameGetNodeInformationRequest))
        self.assertEqual(frame.node_id, 23)

    def test_str(self):
        """Test string representation of FrameGetNodeInformationRequest."""
        frame = FrameGetNodeInformationRequest(node_id=23)
        self.assertEqual(str(frame), '<FrameGetNodeInformationRequest node_id="23"/>')