'Tests the happy path for updating a volume attachment.'

@mock.patch('nova.volume.cinder.cinderclient')
def test_attachment_update(self, mock_cinderclient):

    fake_attachment = FakeAttachment()
    expected_attachment_ref = {'id': uuids.attachment_id, 'status': 'attached', 'instance': fake_attachment.instance, 'volume_id': fake_attachment.volume_id, 'attached_at': fake_attachment.attached_at, 'detached_at': None, 'attach_mode': 'rw', 'connection_info': {'driver_volume_type': 'fake_type', 'data': {'foo': 'bar', 'target_lun': '1'}}}
    mock_cinderclient.return_value.attachments.update.return_value = fake_attachment
    result = self.api.attachment_update(self.ctx, uuids.attachment_id, connector={'host': 'fake-host'})
    self.assertEqual(expected_attachment_ref, result)
