'Test a single device using the autodiscovery provided by HASS.'

@mock.patch('soco.SoCo', new=SoCoMock)
@mock.patch('socket.create_connection', side_effect=socket.error())
def test_ensure_setup_discovery(self, *args):

    sonos.setup_platform(self.hass, {}, fake_add_device, {'host': '192.0.2.1'})
    self.assertEqual(len(self.hass.data[sonos.DATA_SONOS]), 1)
    self.assertEqual(self.hass.data[sonos.DATA_SONOS][0].name, 'Kitchen')
