@patch('homeassistant.helpers.entity_component.EntityComponent._async_setup_platform', return_value=mock_coro())
@patch('homeassistant.setup.async_setup_component', return_value=mock_coro(True))
def test_setup_does_discovery(self, mock_setup_component, mock_setup):
    'Test setup for discovery.'
    component = EntityComponent(_LOGGER, DOMAIN, self.hass)
    component.setup({})
    discovery.load_platform(self.hass, DOMAIN, 'platform_test', {'msg': 'discovery_info'}, {DOMAIN: {}})
    self.hass.block_till_done()
    assert mock_setup.called
    assert (('platform_test', {}, {'msg': 'discovery_info'}) == mock_setup.call_args[0])
Test setup for discovery.
@patch('homeassistant.helpers.entity_component.EntityComponent._async_setup_platform', return_value=mock_coro())
@patch('homeassistant.setup.async_setup_component', return_value=mock_coro(True))
def test_setup_does_discovery(self, mock_setup_component, mock_setup):
    
    component = EntityComponent(_LOGGER, DOMAIN, self.hass)
    component.setup({})
    discovery.load_platform(self.hass, DOMAIN, 'platform_test', {'msg': 'discovery_info'}, {DOMAIN: {}})
    self.hass.block_till_done()
    assert mock_setup.called
    assert (('platform_test', {}, {'msg': 'discovery_info'}) == mock_setup.call_args[0])