Skip to content

Commit d324e37

Browse files
committed
move make_msg
1 parent 4e928b2 commit d324e37

File tree

3 files changed

+6
-8
lines changed

3 files changed

+6
-8
lines changed

tests/unit/io/test_asyncorereactor.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
from cassandra.connection import ConnectionException, ProtocolError
2929
from cassandra.io.asyncorereactor import AsyncoreConnection
3030
from cassandra.protocol import (SupportedMessage, ReadyMessage, ServerError)
31-
from cassandra.marshal import uint32_pack, int32_pack
31+
from cassandra.marshal import int32_pack
3232
from tests import is_monkey_patched
3333
from tests.unit.io.utils import submit_and_wait_for_completion, TimerCallback, ReactorTestMixin
3434

@@ -61,9 +61,6 @@ def setUp(self):
6161
if is_monkey_patched():
6262
raise unittest.SkipTest("Can't test asyncore with monkey patching")
6363

64-
def make_msg(self, header, body=six.binary_type()):
65-
return header + uint32_pack(len(body)) + body
66-
6764
def test_successful_connection(self):
6865
c = self.make_connection()
6966

tests/unit/io/test_libevreactor.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626

2727
from cassandra.connection import ConnectionException, ProtocolError
2828
from cassandra.protocol import (SupportedMessage, ReadyMessage, ServerError)
29-
from cassandra.marshal import uint32_pack, int32_pack
29+
from cassandra.marshal import int32_pack
3030

3131
from tests import is_monkey_patched
3232
from tests.unit.io.utils import ReactorTestMixin
@@ -51,8 +51,6 @@ def setUp(self):
5151
raise unittest.SkipTest('libev does not appear to be installed correctly')
5252
LibevConnection.initialize_reactor()
5353

54-
def make_msg(self, header, body=six.binary_type()):
55-
return header + uint32_pack(len(body)) + body
5654
# we patch here rather than as a decorator so that the Mixin can avoid
5755
# specifying patch args to test methods
5856
patchers = [patch(obj) for obj in

tests/unit/io/utils.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
# limitations under the License.
1414

1515
from cassandra.connection import HEADER_DIRECTION_TO_CLIENT
16-
from cassandra.marshal import uint8_pack
16+
from cassandra.marshal import uint8_pack, uint32_pack
1717
from cassandra.protocol import write_stringmultimap, write_int, write_string
1818

1919
from six import binary_type, BytesIO
@@ -180,3 +180,6 @@ def make_error_body(self, code, msg):
180180
write_int(buf, code)
181181
write_string(buf, msg)
182182
return buf.getvalue()
183+
184+
def make_msg(self, header, body=binary_type()):
185+
return header + uint32_pack(len(body)) + body

0 commit comments

Comments
 (0)