def test_setting_up_group(self):
    'Set up the setting of a group.'
    setup_component(self.hass, 'group', {'group': {}})
    component = EntityComponent(_LOGGER, DOMAIN, self.hass, group_name='everyone')
    assert (len(self.hass.states.entity_ids()) == 0)
    component.add_entities([MockEntity()])
    self.hass.block_till_done()
    assert (len(self.hass.states.entity_ids()) == 2)
    assert (self.hass.states.entity_ids('group') == ['group.everyone'])
    group = self.hass.states.get('group.everyone')
    assert (group.attributes.get('entity_id') == ('test_domain.unnamed_device',))
    component.add_entities([MockEntity(name='goodbye')])
    self.hass.block_till_done()
    assert (len(self.hass.states.entity_ids()) == 3)
    group = self.hass.states.get('group.everyone')
    assert (group.attributes.get('entity_id') == ('test_domain.goodbye', 'test_domain.unnamed_device'))
Set up the setting of a group.
def test_setting_up_group(self):
    
    setup_component(self.hass, 'group', {'group': {}})
    component = EntityComponent(_LOGGER, DOMAIN, self.hass, group_name='everyone')
    assert (len(self.hass.states.entity_ids()) == 0)
    component.add_entities([MockEntity()])
    self.hass.block_till_done()
    assert (len(self.hass.states.entity_ids()) == 2)
    assert (self.hass.states.entity_ids('group') == ['group.everyone'])
    group = self.hass.states.get('group.everyone')
    assert (group.attributes.get('entity_id') == ('test_domain.unnamed_device',))
    component.add_entities([MockEntity(name='goodbye')])
    self.hass.block_till_done()
    assert (len(self.hass.states.entity_ids()) == 3)
    group = self.hass.states.get('group.everyone')
    assert (group.attributes.get('entity_id') == ('test_domain.goodbye', 'test_domain.unnamed_device'))