'Test platform setup.'

def test_platform_setup(self):

    config = {'name': 'test', 'platform': 'universal'}
    bad_config = {'platform': 'universal'}
    entities = []
    def add_devices(new_entities):
        'Add    devices    to    list.'
        for dev in new_entities:
            entities.append(dev)
    run_coroutine_threadsafe(universal.async_setup_platform(self.hass, bad_config, add_devices), self.hass.loop).result()
    self.assertEqual(0, len(entities))
    run_coroutine_threadsafe(universal.async_setup_platform(self.hass, config, add_devices), self.hass.loop).result()
    self.assertEqual(1, len(entities))
    self.assertEqual('test', entities[0].name)
