mirror of
https://github.com/python/cpython.git
synced 2025-08-04 08:59:19 +00:00
Issue #20254: Fix duplicate tests in test_socket
Patch by Vajrasky Kok.
This commit is contained in:
parent
d556a35242
commit
480b069270
1 changed files with 4 additions and 2 deletions
|
@ -4629,9 +4629,10 @@ class BufferIOTest(SocketConnectedTest):
|
|||
SocketConnectedTest.__init__(self, methodName=methodName)
|
||||
|
||||
def testRecvIntoArray(self):
|
||||
buf = bytearray(1024)
|
||||
buf = array.array("B", [0] * len(MSG))
|
||||
nbytes = self.cli_conn.recv_into(buf)
|
||||
self.assertEqual(nbytes, len(MSG))
|
||||
buf = buf.tobytes()
|
||||
msg = buf[:len(MSG)]
|
||||
self.assertEqual(msg, MSG)
|
||||
|
||||
|
@ -4658,9 +4659,10 @@ class BufferIOTest(SocketConnectedTest):
|
|||
_testRecvIntoMemoryview = _testRecvIntoArray
|
||||
|
||||
def testRecvFromIntoArray(self):
|
||||
buf = bytearray(1024)
|
||||
buf = array.array("B", [0] * len(MSG))
|
||||
nbytes, addr = self.cli_conn.recvfrom_into(buf)
|
||||
self.assertEqual(nbytes, len(MSG))
|
||||
buf = buf.tobytes()
|
||||
msg = buf[:len(MSG)]
|
||||
self.assertEqual(msg, MSG)
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue