'Ensuring soco methods called for sonos_restor service.'

@mock.patch('soco.SoCo', new=SoCoMock)
@mock.patch('socket.create_connection', side_effect=socket.error())
@mock.patch.object(soco.snapshot.Snapshot, 'restore')
def test_sonos_restore(self, restoreMock, *args):

    from soco.snapshot import Snapshot
    sonos.setup_platform(self.hass, {}, fake_add_device, {'host': '192.0.2.1'})
    device = self.hass.data[sonos.DATA_SONOS][(-1)]
    device.hass = self.hass
    restoreMock.return_value = True
    device._snapshot_coordinator = mock.MagicMock()
    device._snapshot_coordinator.soco_device = SoCoMock('192.0.2.17')
    device._soco_snapshot = Snapshot(device._player)
    device.restore()
    self.assertEqual(restoreMock.call_count, 1)
    self.assertEqual(restoreMock.call_args, mock.call(False))
