MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / test_prepare_flag

Method test_prepare_flag

tests/unit/test_protocol.py:134–152  ·  view source on GitHub ↗

Test to check the prepare flag is properly set, This should only happen for V5 at the moment. @since 3.9 @jira_ticket PYTHON-694, PYTHON-713 @expected_result the values are correctly written @test_category connection

(self)

Source from the content-addressed store, hash-verified

132 self.assertEqual(uint32_unpack(io.write.mock_calls[5][1][0]), max_pages_per_second)
133
134 def test_prepare_flag(self):
135 """
136 Test to check the prepare flag is properly set, This should only happen for V5 at the moment.
137
138 @since 3.9
139 @jira_ticket PYTHON-694, PYTHON-713
140 @expected_result the values are correctly written
141
142 @test_category connection
143 """
144 message = PrepareMessage("a")
145 io = Mock()
146 for version in ProtocolVersion.SUPPORTED_VERSIONS:
147 message.send_body(io, version)
148 if ProtocolVersion.uses_prepare_flags(version):
149 self.assertEqual(len(io.write.mock_calls), 3)
150 else:
151 self.assertEqual(len(io.write.mock_calls), 2)
152 io.reset_mock()
153
154 def test_prepare_flag_with_keyspace(self):
155 message = PrepareMessage("a", keyspace='ks')

Callers

nothing calls this directly

Calls 3

send_bodyMethod · 0.95
PrepareMessageClass · 0.90
uses_prepare_flagsMethod · 0.80

Tested by

no test coverage detected