Files
deb-python-cassandra-driver/tests/integration/cqlengine/statements/test_base_statement.py
Adam Holmberg 1ffd4dd0bb cqle: make statements collect primary key values
initially for DML path; still need to address queryset

PYTHON-535
2016-04-01 10:14:48 -05:00

35 lines
1.2 KiB
Python

# Copyright 2013-2016 DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
try:
import unittest2 as unittest
except ImportError:
import unittest # noqa
from cassandra.query import FETCH_SIZE_UNSET
from cassandra.cqlengine.statements import BaseCQLStatement
class BaseStatementTest(unittest.TestCase):
def test_fetch_size(self):
""" tests that fetch_size is correctly set """
stmt = BaseCQLStatement('table', None, fetch_size=1000)
self.assertEqual(stmt.fetch_size, 1000)
stmt = BaseCQLStatement('table', None, fetch_size=None)
self.assertEqual(stmt.fetch_size, FETCH_SIZE_UNSET)
stmt = BaseCQLStatement('table', None)
self.assertEqual(stmt.fetch_size, FETCH_SIZE_UNSET)