'Test list with negative and non numeric limit and offset.'

@mock.patch.object(db, 'snapshot_get_all_by_project')
@mock.patch('cinder.db.snapshot_metadata_get', return_value=dict())
def test_list_snpashots_with_wrong_limit_and_offset(self, mock_metadata_get, mock_snapshot_get_all):

    mock_snapshot_get_all.return_value = []
    req = fakes.HTTPRequest.blank('/v2/snapshots?limit=-1&offset=1')
    self.assertRaises(webob.exc.HTTPBadRequest, self.controller.index, req)
    req = fakes.HTTPRequest.blank('/v2/snapshots?limit=a&offset=1')
    self.assertRaises(webob.exc.HTTPBadRequest, self.controller.index, req)
    req = fakes.HTTPRequest.blank('/v2/snapshots?limit=1&offset=-1')
    self.assertRaises(webob.exc.HTTPBadRequest, self.controller.index, req)
    req = fakes.HTTPRequest.blank('/v2/snapshots?limit=1&offset=a')
    self.assertRaises(webob.exc.HTTPBadRequest, self.controller.index, req)
    url = '/v2/snapshots?limit=1&offset=323245324356534235'
    req = fakes.HTTPRequest.blank(url)
    self.assertRaises(webob.exc.HTTPBadRequest, self.controller.index, req)
