Check the example asyncore integration.
(self)
| 3808 | self.assertEqual(d1, d2) |
| 3809 | |
| 3810 | def test_asyncore_server(self): |
| 3811 | """Check the example asyncore integration.""" |
| 3812 | if support.verbose: |
| 3813 | sys.stdout.write("\n") |
| 3814 | |
| 3815 | indata = b"FOO\n" |
| 3816 | server = AsyncoreEchoServer(CERTFILE) |
| 3817 | with server: |
| 3818 | s = test_wrap_socket(socket.socket()) |
| 3819 | s.connect(('127.0.0.1', server.port)) |
| 3820 | if support.verbose: |
| 3821 | sys.stdout.write( |
| 3822 | " client: sending %r...\n" % indata) |
| 3823 | s.write(indata) |
| 3824 | outdata = s.read() |
| 3825 | if support.verbose: |
| 3826 | sys.stdout.write(" client: read %r\n" % outdata) |
| 3827 | if outdata != indata.lower(): |
| 3828 | self.fail( |
| 3829 | "bad data <<%r>> (%d) received; expected <<%r>> (%d)\n" |
| 3830 | % (outdata[:20], len(outdata), |
| 3831 | indata[:20].lower(), len(indata))) |
| 3832 | s.write(b"over\n") |
| 3833 | if support.verbose: |
| 3834 | sys.stdout.write(" client: closing connection.\n") |
| 3835 | s.close() |
| 3836 | if support.verbose: |
| 3837 | sys.stdout.write(" client: connection closed.\n") |
| 3838 | |
| 3839 | def test_recv_send(self): |
| 3840 | """Test recv(), send() and friends.""" |
nothing calls this directly
no test coverage detected