def test_state_with_children_and_attrs(self):
        config = self.config_children_and_attr
        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(STATE_OFF, ump.state)

        self.hass.states.set(self.mock_state_switch_id, STATE_ON)
        ump.update()
        self.assertEqual(STATE_ON, ump.state)

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

        self.hass.states.set(self.mock_state_switch_id, STATE_OFF)
        ump.update()
        self.assertEqual(STATE_OFF, ump.state)
Test media player with children and master state.
dataset/ETHPy150Open home-assistant/home-assistant/tests/components/media_player/test_universal.py/TestMediaPlayer.test_state_with_children_and_attrs