'Test setup with discovery.'

@mock.patch('libsoundtouch.soundtouch_device', side_effect=None)
def test_ensure_setup_discovery(self, mocked_sountouch_device):

    new_device = {'port': '8090', 'host': '192.168.1.1', 'properties': {}, 'hostname': 'hostname.local'}
    soundtouch.setup_platform(self.hass, None, mock.MagicMock(), new_device)
    all_devices = self.hass.data[soundtouch.DATA_SOUNDTOUCH]
    self.assertEqual(len(all_devices), 1)
    self.assertEqual(all_devices[0].config['port'], 8090)
    self.assertEqual(all_devices[0].config['host'], '192.168.1.1')
    self.assertEqual(mocked_sountouch_device.call_count, 1)
