def test_active_child_state(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'])
        ump.update()

        self.assertEqual(None, ump._child_state)

        self.mock_mp_1._state = STATE_PLAYING
        self.mock_mp_1.update_ha_state()
        ump.update()
        self.assertEqual(self.mock_mp_1.entity_id,
                         ump._child_state.entity_id)

        self.mock_mp_2._state = STATE_PLAYING
        self.mock_mp_2.update_ha_state()
        ump.update()
        self.assertEqual(self.mock_mp_1.entity_id,
                         ump._child_state.entity_id)

        self.mock_mp_1._state = STATE_OFF
        self.mock_mp_1.update_ha_state()
        ump.update()
        self.assertEqual(self.mock_mp_2.entity_id,
                         ump._child_state.entity_id)
Test active child state property.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/media_player/test_universal.py/TestMediaPlayer.test_active_child_state