Skip to content

Commit daffcd3

Browse files
committed
Set execution profile for tests, remove batch counter cqlengine test
1 parent 60cf6f9 commit daffcd3

4 files changed

Lines changed: 9 additions & 14 deletions

File tree

tests/integration/cqlengine/query/test_batch_query.py

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def tearDown(self):
220220
drop_table(TestMultiKeyModel)
221221
drop_table(CounterBatchQueryModel)
222222

223-
@execute_count(6)
223+
@execute_count(4)
224224
def test_cassandra_batch_type(self):
225225
"""
226226
Tests the different types of `class: cassandra.query.BatchType`
@@ -239,15 +239,6 @@ def test_cassandra_batch_type(self):
239239
obj = TestMultiKeyModel.objects(partition=1)
240240
self.assertEqual(2, len(obj))
241241

242-
with BatchQuery(batch_type=cassandra_BatchType.COUNTER) as b:
243-
CounterBatchQueryModel.batch(b).create(k=1, v=1)
244-
CounterBatchQueryModel.batch(b).create(k=1, v=2)
245-
CounterBatchQueryModel.batch(b).create(k=1, v=10)
246-
247-
obj = CounterBatchQueryModel.objects(k=1)
248-
self.assertEqual(1, len(obj))
249-
self.assertEqual(obj[0].v, 13)
250-
251242
with BatchQuery(batch_type=cassandra_BatchType.LOGGED) as b:
252243
TestMultiKeyModel.batch(b).create(partition=1, cluster=1)
253244
TestMultiKeyModel.batch(b).create(partition=1, cluster=2)

tests/integration/cqlengine/test_ttl.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from uuid import uuid4
2929
from cassandra.cqlengine import columns
3030
from cassandra.cqlengine.connection import get_session
31-
from tests.integration import CASSANDRA_VERSION, greaterthancass20
31+
from tests.integration import CASSANDRA_VERSION
3232

3333

3434
class BaseTTLTest(BaseCassEngTestCase):

tests/integration/simulacron/test_connection.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,12 @@ def test_driver_recovers_nework_isolation(self):
358358
listener = TrackDownListener()
359359

360360
cluster = Cluster(['127.0.0.1'],
361-
load_balancing_policy=RoundRobinPolicy(),
362361
idle_heartbeat_timeout=idle_heartbeat_timeout,
363362
idle_heartbeat_interval=idle_heartbeat_interval,
364-
executor_threads=16)
363+
executor_threads=16,
364+
execution_profiles={
365+
EXEC_PROFILE_DEFAULT: ExecutionProfile(load_balancing_policy=RoundRobinPolicy())}
366+
)
365367
session = cluster.connect(wait_for_all_pools=True)
366368

367369
cluster.register_listener(listener)

tests/integration/simulacron/test_policies.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ def test_setting_retry_policy_to_statement(self):
384384

385385
def set_cluster(self, retry_policy):
386386
self.cluster = Cluster(protocol_version=PROTOCOL_VERSION, compression=False,
387-
default_retry_policy=retry_policy)
387+
execution_profiles={
388+
EXEC_PROFILE_DEFAULT: ExecutionProfile(retry_policy=retry_policy)}
389+
)
388390
self.session = self.cluster.connect(wait_for_all_pools=True)
389391
self.addCleanup(self.cluster.shutdown)

0 commit comments

Comments
 (0)