Example #1
0
 def test_nq(self):
     """Testing eq method with negative results."""
     pyvlx = PyVLX()
     node1 = Blind(pyvlx=pyvlx, node_id=23, name='xxx')
     node2 = Blind(pyvlx=pyvlx, node_id=24, name='xxx')
     node3 = RollerShutter(pyvlx=pyvlx, node_id=23, name='xxx')
     self.assertNotEqual(node1, node2)
     self.assertNotEqual(node2, node3)
     self.assertNotEqual(node3, node1)
Example #2
0
 def test_eq(self):
     """Testing eq method with positive results."""
     pyvlx = PyVLX()
     node1 = Blind(pyvlx=pyvlx,
                   node_id=23,
                   name="xxx",
                   serial_number="aa:bb:aa:bb:aa:bb:aa:23")
     node2 = Blind(pyvlx=pyvlx,
                   node_id=23,
                   name="xxx",
                   serial_number="aa:bb:aa:bb:aa:bb:aa:23")
     self.assertEqual(node1, node2)
Example #3
0
 def test_str(self):
     """Test string representation of Blind objec."""
     pyvlx = PyVLX()
     blind = Blind(pyvlx, 0, 'Test Blind', 0, 2)
     self.assertEqual(
         str(blind), '<Blind name="Test Blind" id="0" subtype="0" '
         'typeId="2" />')
Example #4
0
 def test_blind(self):
     """Test convert_frame_to_node with blind."""
     frame = FrameGetNodeInformationNotification()
     frame.node_id = 23
     frame.name = "Fnord23"
     frame.node_type = NodeTypeWithSubtype.INTERIOR_VENETIAN_BLIND
     pyvlx = PyVLX()
     node = convert_frame_to_node(pyvlx, frame)
     self.assertEqual(node, Blind(pyvlx=pyvlx, name="Fnord23", node_id=23))
Example #5
0
 def test_nq(self):
     """Testing eq method with negative results."""
     pyvlx = PyVLX()
     node1 = Blind(pyvlx=pyvlx,
                   node_id=23,
                   name="xxx",
                   serial_number="aa:bb:aa:bb:aa:bb:aa:23")
     node2 = Blind(pyvlx=pyvlx,
                   node_id=24,
                   name="xxx",
                   serial_number="aa:bb:aa:bb:aa:bb:aa:24")
     node3 = RollerShutter(pyvlx=pyvlx,
                           node_id=23,
                           name="xxx",
                           serial_number="aa:bb:aa:bb:aa:bb:aa:23")
     self.assertNotEqual(node1, node2)
     self.assertNotEqual(node2, node3)
     self.assertNotEqual(node3, node1)
Example #6
0
 def test_blind_str(self):
     """Test string representation of Blind object."""
     pyvlx = PyVLX()
     blind = Blind(
         pyvlx=pyvlx,
         node_id=23,
         name="Test Blind",
         serial_number="aa:bb:aa:bb:aa:bb:aa:23",
     )
     self.assertEqual(
         str(blind),
         '<Blind name="Test Blind" node_id="23" serial_number="aa:bb:aa:bb:aa:bb:aa:23" position="UNKNOWN"/>',
     )
Example #7
0
 def test_get_item(self):
     """Test get_item."""
     pyvlx = PyVLX()
     nodes = Nodes(pyvlx)
     window = Window(pyvlx, 0, 'Window')
     nodes.add(window)
     blind = Blind(pyvlx, 1, 'Blind')
     nodes.add(blind)
     roller_shutter = RollerShutter(pyvlx, 4, 'Roller Shutter')
     nodes.add(roller_shutter)
     self.assertEqual(nodes['Window'], window)
     self.assertEqual(nodes['Blind'], blind)
     self.assertEqual(nodes['Roller Shutter'], roller_shutter)
     self.assertEqual(nodes[0], window)
     self.assertEqual(nodes[1], blind)
     self.assertEqual(nodes[4], roller_shutter)
Example #8
0
 def test_get_item(self):
     """Test get_item."""
     pyvlx = PyVLX()
     nodes = Nodes(pyvlx)
     window = Window(pyvlx, 0, "Window", "aa:bb:aa:bb:aa:bb:aa:00")
     nodes.add(window)
     blind = Blind(pyvlx, 1, "Blind", "aa:bb:aa:bb:aa:bb:aa:01")
     nodes.add(blind)
     roller_shutter = RollerShutter(pyvlx, 4, "Roller Shutter",
                                    "aa:bb:aa:bb:aa:bb:aa:04")
     nodes.add(roller_shutter)
     self.assertEqual(nodes["Window"], window)
     self.assertEqual(nodes["Blind"], blind)
     self.assertEqual(nodes["Roller Shutter"], roller_shutter)
     self.assertEqual(nodes[0], window)
     self.assertEqual(nodes[1], blind)
     self.assertEqual(nodes[4], roller_shutter)
Example #9
0
 def test_get_name(self):
     """Test get_name()."""
     pyvlx = PyVLX()
     blind = Blind(pyvlx, 0, 'Test Blind', 0, 2)
     self.assertEqual(blind.get_name(), "Test Blind")
Example #10
0
 def test_eq(self):
     """Testing eq method with positive results."""
     pyvlx = PyVLX()
     node1 = Blind(pyvlx=pyvlx, node_id=23, name='xxx')
     node2 = Blind(pyvlx=pyvlx, node_id=23, name='xxx')
     self.assertEqual(node1, node2)
Example #11
0
 def test_blind_str(self):
     """Test string representation of Blind object."""
     pyvlx = PyVLX()
     blind = Blind(pyvlx=pyvlx, node_id=23, name='Test Blind')
     self.assertEqual(str(blind), '<Blind name="Test Blind" node_id="23"/>')