'Test manage snapshot failure due to disabled service.'

@mock.patch('cinder.objects.service.Service.is_up', return_value=True, new_callable=mock.PropertyMock)
@mock.patch('cinder.volume.rpcapi.VolumeAPI.manage_existing_snapshot')
@mock.patch('cinder.volume.api.API.create_snapshot_in_db')
@mock.patch('cinder.db.sqlalchemy.api.service_get')
def test_manage_snapshot_disabled(self, mock_db, mock_create_snapshot, mock_rpcapi, mock_is_up):

    mock_db.return_value = fake_service.fake_service_obj(self._admin_ctxt, disabled=True)
    body = {'snapshot': {'volume_id': fake.VOLUME_ID, 'ref': 'fake_ref'}}
    res = self._get_resp_post(body)
    self.assertEqual(http_client.BAD_REQUEST, res.status_int, res)
    self.assertEqual(exception.ServiceUnavailable.message, res.json['badRequest']['message'])
    mock_create_snapshot.assert_not_called()
    mock_rpcapi.assert_not_called()
    mock_is_up.assert_not_called()
