def test_source_select(self): """Test the input source service.""" entity_id = 'media_player.lounge_room' assert setup_component( self.hass, mp.DOMAIN, {'media_player': {'platform': 'demo'}}) state = self.hass.states.get(entity_id) assert 'dvd' == state.attributes.get('source') common.select_source(self.hass, None, entity_id) self.hass.block_till_done() state = self.hass.states.get(entity_id) assert 'dvd' == state.attributes.get('source') common.select_source(self.hass, 'xbox', entity_id) self.hass.block_till_done() state = self.hass.states.get(entity_id) assert 'xbox' == state.attributes.get('source')
def test_source_select(self): """Test the input source service.""" entity_id = 'media_player.lounge_room' assert setup_component(self.hass, mp.DOMAIN, {'media_player': { 'platform': 'demo' }}) state = self.hass.states.get(entity_id) assert 'dvd' == state.attributes.get('source') common.select_source(self.hass, None, entity_id) self.hass.block_till_done() state = self.hass.states.get(entity_id) assert 'dvd' == state.attributes.get('source') common.select_source(self.hass, 'xbox', entity_id) self.hass.block_till_done() state = self.hass.states.get(entity_id) assert 'xbox' == state.attributes.get('source')
def test_source_select(self): """Test the input source service.""" entity_id = "media_player.lounge_room" assert setup_component( self.hass, mp.DOMAIN, {"media_player": {"platform": "demo"}} ) state = self.hass.states.get(entity_id) assert "dvd" == state.attributes.get("source") with pytest.raises(vol.Invalid): common.select_source(self.hass, None, entity_id) self.hass.block_till_done() state = self.hass.states.get(entity_id) assert "dvd" == state.attributes.get("source") common.select_source(self.hass, "xbox", entity_id) self.hass.block_till_done() state = self.hass.states.get(entity_id) assert "xbox" == state.attributes.get("source")