Ejemplo n.º 1
0
 def test_info_set_uninitialized(self):
     """Test for info if RemoteValue is not initialized."""
     xknx = XKNX(loop=self.loop)
     remote_value = RemoteValue(xknx)
     with patch('logging.Logger.info') as mock_info:
         self.loop.run_until_complete(asyncio.Task(remote_value.set(23)))
         mock_info.assert_called_with(
             'Setting value of uninitialized device: %s (value: %s)',
             'Unknown', 23)
Ejemplo n.º 2
0
 def test_info_set_unwritable(self):
     """Test for warning if RemoteValue is read only."""
     xknx = XKNX(loop=self.loop)
     remote_value = RemoteValue(xknx,
                                group_address_state=GroupAddress('1/2/3'))
     with patch('logging.Logger.warning') as mock_info:
         self.loop.run_until_complete(asyncio.Task(remote_value.set(23)))
         mock_info.assert_called_with(
             'Attempted to set value for non-writable device: %s (value: %s)',
             'Unknown', 23)
Ejemplo n.º 3
0
 def test_info_set_uninitialized(self):
     """Test for info if RemoteValue is not initialized."""
     xknx = XKNX()
     remote_value = RemoteValue(xknx)
     with patch("logging.Logger.info") as mock_info:
         self.loop.run_until_complete(remote_value.set(23))
         mock_info.assert_called_with(
             "Setting value of uninitialized device: %s - %s (value: %s)",
             "Unknown",
             "Unknown",
             23,
         )
Ejemplo n.º 4
0
 def test_info_set_unwritable(self):
     """Test for warning if RemoteValue is read only."""
     xknx = XKNX()
     remote_value = RemoteValue(xknx, group_address_state=GroupAddress("1/2/3"))
     with patch("logging.Logger.warning") as mock_info:
         self.loop.run_until_complete(remote_value.set(23))
         mock_info.assert_called_with(
             "Attempted to set value for non-writable device: %s - %s (value: %s)",
             "Unknown",
             "Unknown",
             23,
         )