Check the example asyncore integration.
(self)
| 3525 | self.assertEqual(d1, d2) |
| 3526 | |
| 3527 | def test_asyncore_server(self): |
| 3528 | """Check the example asyncore integration.""" |
| 3529 | if support.verbose: |
| 3530 | sys.stdout.write("\n") |
| 3531 | |
| 3532 | indata = b"FOO\n" |
| 3533 | server = AsyncoreEchoServer(CERTFILE) |
| 3534 | with server: |
| 3535 | s = test_wrap_socket(socket.socket()) |
| 3536 | s.connect(('127.0.0.1', server.port)) |
| 3537 | if support.verbose: |
| 3538 | sys.stdout.write( |
| 3539 | " client: sending %r...\n" % indata) |
| 3540 | s.write(indata) |
| 3541 | outdata = s.read() |
| 3542 | if support.verbose: |
| 3543 | sys.stdout.write(" client: read %r\n" % outdata) |
| 3544 | if outdata != indata.lower(): |
| 3545 | self.fail( |
| 3546 | "bad data <<%r>> (%d) received; expected <<%r>> (%d)\n" |
| 3547 | % (outdata[:20], len(outdata), |
| 3548 | indata[:20].lower(), len(indata))) |
| 3549 | s.write(b"over\n") |
| 3550 | if support.verbose: |
| 3551 | sys.stdout.write(" client: closing connection.\n") |
| 3552 | s.close() |
| 3553 | if support.verbose: |
| 3554 | sys.stdout.write(" client: connection closed.\n") |
| 3555 | |
| 3556 | def test_recv_send(self): |
| 3557 | """Test recv(), send() and friends.""" |
nothing calls this directly
no test coverage detected