Skip to content

Commit d054886

Browse files
committed
tests: fix borrow_connection assertions to include tablet= parameter
1 parent 96d2386 commit d054886

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

tests/unit/test_response_future.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ def test_result_message(self):
7777
rf.send_request()
7878

7979
rf.session._pools.get.assert_called_once_with('ip1')
80-
pool.borrow_connection.assert_called_once_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY)
80+
pool.borrow_connection.assert_called_once_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY, tablet=ANY)
8181

8282
connection.send_msg.assert_called_once_with(rf.message, 1, cb=ANY, encoder=ProtocolHandler.encode_message, decoder=ProtocolHandler.decode_message, result_metadata=[])
8383

@@ -267,7 +267,7 @@ def test_retry_policy_says_retry(self):
267267
rf.send_request()
268268

269269
rf.session._pools.get.assert_called_once_with('ip1')
270-
pool.borrow_connection.assert_called_once_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY)
270+
pool.borrow_connection.assert_called_once_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY, tablet=ANY)
271271
connection.send_msg.assert_called_once_with(rf.message, 1, cb=ANY, encoder=ProtocolHandler.encode_message, decoder=ProtocolHandler.decode_message, result_metadata=[])
272272

273273
result = Mock(spec=UnavailableErrorMessage, info={})
@@ -286,7 +286,7 @@ def test_retry_policy_says_retry(self):
286286
# it should try again with the same host since this was
287287
# an UnavailableException
288288
rf.session._pools.get.assert_called_with(host)
289-
pool.borrow_connection.assert_called_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY)
289+
pool.borrow_connection.assert_called_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY, tablet=ANY)
290290
connection.send_msg.assert_called_with(rf.message, 2, cb=ANY, encoder=ProtocolHandler.encode_message, decoder=ProtocolHandler.decode_message, result_metadata=[])
291291

292292
def test_retry_with_different_host(self):
@@ -301,7 +301,7 @@ def test_retry_with_different_host(self):
301301
rf.send_request()
302302

303303
rf.session._pools.get.assert_called_once_with('ip1')
304-
pool.borrow_connection.assert_called_once_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY)
304+
pool.borrow_connection.assert_called_once_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY, tablet=ANY)
305305
connection.send_msg.assert_called_once_with(rf.message, 1, cb=ANY, encoder=ProtocolHandler.encode_message, decoder=ProtocolHandler.decode_message, result_metadata=[])
306306
assert ConsistencyLevel.QUORUM == rf.message.consistency_level
307307

@@ -320,7 +320,7 @@ def test_retry_with_different_host(self):
320320

321321
# it should try with a different host
322322
rf.session._pools.get.assert_called_with('ip2')
323-
pool.borrow_connection.assert_called_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY)
323+
pool.borrow_connection.assert_called_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY, tablet=ANY)
324324
connection.send_msg.assert_called_with(rf.message, 2, cb=ANY, encoder=ProtocolHandler.encode_message, decoder=ProtocolHandler.decode_message, result_metadata=[])
325325

326326
# the consistency level should be the same
@@ -701,7 +701,7 @@ def test_single_host_query_plan_exhausted_after_one_retry(self):
701701

702702
# Verify initial request was sent
703703
rf.session._pools.get.assert_called_once_with(specific_host)
704-
pool.borrow_connection.assert_called_once_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY)
704+
pool.borrow_connection.assert_called_once_with(timeout=ANY, routing_key=ANY, keyspace=ANY, table=ANY, tablet=ANY)
705705
connection.send_msg.assert_called_once_with(rf.message, 1, cb=ANY, encoder=ProtocolHandler.encode_message, decoder=ProtocolHandler.decode_message, result_metadata=[])
706706

707707
# Simulate a ServerError response (which triggers RETRY_NEXT_HOST by default)

0 commit comments

Comments
 (0)