Пример #1
0
 def test_setup(self, samsung_mock, wol_mock):
     """Testing setup of platform."""
     with mock.patch(
             'homeassistant.components.media_player.samsungtv.socket'):
         add_entities = mock.Mock()
         setup_platform(
             self.hass, WORKING_CONFIG, add_entities)
Пример #2
0
 def test_setup_discovery(self, samsung_mock, wol_mock):
     """Testing setup of platform with discovery."""
     with mock.patch(
             'homeassistant.components.media_player.samsungtv.socket'):
         add_entities = mock.Mock()
         setup_platform(self.hass, {}, add_entities,
                        discovery_info=DISCOVERY_INFO)
Пример #3
0
 def test_setup_none(self, samsung_mock, wol_mock, mocked_warn):
     """Testing setup of platform with no data."""
     with mock.patch(
             'homeassistant.components.media_player.samsungtv.socket'):
         add_entities = mock.Mock()
         setup_platform(self.hass, {}, add_entities, discovery_info=None)
         mocked_warn.assert_called_once_with("Cannot determine device")
         add_entities.assert_not_called()
Пример #4
0
 def test_setup_none(self, samsung_mock, wol_mock, mocked_warn):
     """Testing setup of platform with no data."""
     with mock.patch(
             'homeassistant.components.media_player.samsungtv.socket'):
         add_entities = mock.Mock()
         setup_platform(self.hass, {}, add_entities,
                        discovery_info=None)
         mocked_warn.assert_called_once_with("Cannot determine device")
         add_entities.assert_not_called()