'Test service calls that should be routed to a child.'

def test_service_call_to_child(self):

    config = self.config_children_only
    universal.validate_config(config)
    ump = universal.UniversalMediaPlayer(self.hass, **config)
    ump.entity_id = media_player.ENTITY_ID_FORMAT.format(config['name'])
    run_coroutine_threadsafe(ump.async_update(), self.hass.loop).result()
    self.mock_mp_2._state = STATE_PLAYING
    self.mock_mp_2.schedule_update_ha_state()
    self.hass.block_till_done()
    run_coroutine_threadsafe(ump.async_update(), self.hass.loop).result()
    run_coroutine_threadsafe(ump.async_turn_off(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['turn_off']))
    run_coroutine_threadsafe(ump.async_turn_on(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['turn_on']))
    run_coroutine_threadsafe(ump.async_mute_volume(True), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['mute_volume']))
    run_coroutine_threadsafe(ump.async_set_volume_level(0.5), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['set_volume_level']))
    run_coroutine_threadsafe(ump.async_media_play(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['media_play']))
    run_coroutine_threadsafe(ump.async_media_pause(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['media_pause']))
    run_coroutine_threadsafe(ump.async_media_previous_track(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['media_previous_track']))
    run_coroutine_threadsafe(ump.async_media_next_track(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['media_next_track']))
    run_coroutine_threadsafe(ump.async_media_seek(100), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['media_seek']))
    run_coroutine_threadsafe(ump.async_play_media('movie', 'batman'), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['play_media']))
    run_coroutine_threadsafe(ump.async_volume_up(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['volume_up']))
    run_coroutine_threadsafe(ump.async_volume_down(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['volume_down']))
    run_coroutine_threadsafe(ump.async_media_play_pause(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['media_play_pause']))
    run_coroutine_threadsafe(ump.async_select_source('dvd'), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['select_source']))
    run_coroutine_threadsafe(ump.async_clear_playlist(), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['clear_playlist']))
    run_coroutine_threadsafe(ump.async_set_shuffle(True), self.hass.loop).result()
    self.assertEqual(1, len(self.mock_mp_2.service_calls['shuffle_set']))
