async def test_setup_entry(hass):
    'Test setup entry calls async_setup_entry on platform.'
    mock_setup_entry = Mock(return_value=mock_coro(True))
    mock_entity_platform(hass, 'test_domain.entry_domain', MockPlatform(async_setup_entry=mock_setup_entry, scan_interval=timedelta(seconds=5)))
    component = EntityComponent(_LOGGER, DOMAIN, hass)
    entry = MockConfigEntry(domain='entry_domain')
    assert (await component.async_setup_entry(entry))
    assert (len(mock_setup_entry.mock_calls) == 1)
    (p_hass, p_entry, p_add_entities) = mock_setup_entry.mock_calls[0][1]
    assert (p_hass is hass)
    assert (p_entry is entry)
    assert (component._platforms[entry.entry_id].scan_interval == timedelta(seconds=5))
Test setup entry calls async_setup_entry on platform.
async def test_setup_entry(hass):
    
    mock_setup_entry = Mock(return_value=mock_coro(True))
    mock_entity_platform(hass, 'test_domain.entry_domain', MockPlatform(async_setup_entry=mock_setup_entry, scan_interval=timedelta(seconds=5)))
    component = EntityComponent(_LOGGER, DOMAIN, hass)
    entry = MockConfigEntry(domain='entry_domain')
    assert (await component.async_setup_entry(entry))
    assert (len(mock_setup_entry.mock_calls) == 1)
    (p_hass, p_entry, p_add_entities) = mock_setup_entry.mock_calls[0][1]
    assert (p_hass is hass)
    assert (p_entry is entry)
    assert (component._platforms[entry.entry_id].scan_interval == timedelta(seconds=5))