MCPcopy Create free account
hub / github.com/apache/cassandra-python-driver / test_query_message

Method test_query_message

tests/unit/test_protocol.py:72–90  ·  view source on GitHub ↗

Test to check the appropriate calls are made @since 3.9 @jira_ticket PYTHON-713 @expected_result the values are correctly written @test_category connection

(self)

Source from the content-addressed store, hash-verified

70 (b'\x00\x00\x00\x01',), (b'\x00\x00',)])
71
72 def test_query_message(self):
73 """
74 Test to check the appropriate calls are made
75
76 @since 3.9
77 @jira_ticket PYTHON-713
78 @expected_result the values are correctly written
79
80 @test_category connection
81 """
82 message = QueryMessage("a", 3)
83 io = Mock()
84
85 message.send_body(io, 4)
86 self._check_calls(io, [(b'\x00\x00\x00\x01',), (b'a',), (b'\x00\x03',), (b'\x00',)])
87
88 io.reset_mock()
89 message.send_body(io, 5)
90 self._check_calls(io, [(b'\x00\x00\x00\x01',), (b'a',), (b'\x00\x03',), (b'\x00\x00\x00\x00',)])
91
92 def _check_calls(self, io, expected):
93 self.assertEqual(

Callers

nothing calls this directly

Calls 3

send_bodyMethod · 0.95
_check_callsMethod · 0.95
QueryMessageClass · 0.90

Tested by

no test coverage detected