Skip to content

Commit 7de86d8

Browse files
committed
Fix integration tests to use new type API
Updated test files to use instantiated types with protocol_version: - test_custom_protocol_handler.py: Changed ctype.from_binary(val, protocol_version) to ctype(protocol_version).from_binary(val) - test_loadbalancingpolicies.py: Changed Int32Type.serialize(i, protocol_version) to Int32Type(protocol_version).serialize(i) These tests were still using the old API where protocol_version was passed as a parameter rather than using type instances.
1 parent 41d6adf commit 7de86d8

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

tests/integration/long/test_loadbalancingpolicies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ def test_token_aware_with_transient_replication(self):
633633
query = session.prepare("SELECT * FROM test_tr.users WHERE id = ?")
634634
for i in range(100):
635635
f = session.execute_async(query, (i,), trace=True)
636-
full_dc1_replicas = [h for h in cluster.metadata.get_replicas('test_tr', cqltypes.Int32Type.serialize(i, cluster.protocol_version))
636+
full_dc1_replicas = [h for h in cluster.metadata.get_replicas('test_tr', cqltypes.Int32Type(cluster.protocol_version).serialize(i))
637637
if h.datacenter == 'dc1']
638638
assert len(full_dc1_replicas) == 2
639639

tests/integration/standard/test_custom_protocol_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ def recv_results_rows(self, f, protocol_version, user_type_map, result_metadata,
241241
self.column_types = [c[3] for c in column_metadata]
242242
self.checked_rev_row_set.update(self.column_types)
243243
self.parsed_rows = [
244-
tuple(ctype.from_binary(val, protocol_version)
244+
tuple(ctype(protocol_version).from_binary(val)
245245
for ctype, val in zip(self.column_types, row))
246246
for row in rows]
247247

0 commit comments

Comments
 (0)