MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_sendbytes

Method test_sendbytes

Lib/test/_test_multiprocessing.py:3514–3544  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

3512 p.join()
3513
3514 def test_sendbytes(self):
3515 if self.TYPE != 'processes':
3516 self.skipTest('test not appropriate for {}'.format(self.TYPE))
3517
3518 msg = latin('abcdefghijklmnopqrstuvwxyz')
3519 a, b = self.Pipe()
3520
3521 a.send_bytes(msg)
3522 self.assertEqual(b.recv_bytes(), msg)
3523
3524 a.send_bytes(msg, 5)
3525 self.assertEqual(b.recv_bytes(), msg[5:])
3526
3527 a.send_bytes(msg, 7, 8)
3528 self.assertEqual(b.recv_bytes(), msg[7:7+8])
3529
3530 a.send_bytes(msg, 26)
3531 self.assertEqual(b.recv_bytes(), latin(''))
3532
3533 a.send_bytes(msg, 26, 0)
3534 self.assertEqual(b.recv_bytes(), latin(''))
3535
3536 self.assertRaises(ValueError, a.send_bytes, msg, 27)
3537
3538 self.assertRaises(ValueError, a.send_bytes, msg, 22, 5)
3539
3540 self.assertRaises(ValueError, a.send_bytes, msg, 26, 1)
3541
3542 self.assertRaises(ValueError, a.send_bytes, msg, -1)
3543
3544 self.assertRaises(ValueError, a.send_bytes, msg, 4, -1)
3545
3546 @classmethod
3547 def _is_fd_assigned(cls, fd):

Callers

nothing calls this directly

Calls 8

latinFunction · 0.85
skipTestMethod · 0.80
PipeMethod · 0.80
formatMethod · 0.45
send_bytesMethod · 0.45
assertEqualMethod · 0.45
recv_bytesMethod · 0.45
assertRaisesMethod · 0.45

Tested by

no test coverage detected