R. David Murray | a21e4ca | 2009-03-31 23:16:50 +0000 | [diff] [blame] | 1 | # test asynchat |
Guido van Rossum | 6617252 | 2001-04-06 16:32:22 +0000 | [diff] [blame] | 2 | |
R. David Murray | a21e4ca | 2009-03-31 23:16:50 +0000 | [diff] [blame] | 3 | from test import support |
Serhiy Storchaka | 1699491 | 2020-04-25 10:06:29 +0300 | [diff] [blame] | 4 | from test.support import socket_helper |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 5 | from test.support import threading_helper |
R. David Murray | a21e4ca | 2009-03-31 23:16:50 +0000 | [diff] [blame] | 6 | |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 7 | import asynchat |
| 8 | import asyncore |
Victor Stinner | 45cff66 | 2014-07-24 18:49:36 +0200 | [diff] [blame] | 9 | import errno |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 10 | import socket |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 11 | import sys |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 12 | import threading |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 13 | import time |
| 14 | import unittest |
Victor Stinner | 45cff66 | 2014-07-24 18:49:36 +0200 | [diff] [blame] | 15 | import unittest.mock |
Guido van Rossum | 6617252 | 2001-04-06 16:32:22 +0000 | [diff] [blame] | 16 | |
Serhiy Storchaka | 1699491 | 2020-04-25 10:06:29 +0300 | [diff] [blame] | 17 | HOST = socket_helper.HOST |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 18 | SERVER_QUIT = b'QUIT\n' |
Guido van Rossum | 6617252 | 2001-04-06 16:32:22 +0000 | [diff] [blame] | 19 | |
Guido van Rossum | 6617252 | 2001-04-06 16:32:22 +0000 | [diff] [blame] | 20 | |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 21 | class echo_server(threading.Thread): |
| 22 | # parameter to determine the number of bytes passed back to the |
| 23 | # client each send |
| 24 | chunk_size = 1 |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 25 | |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 26 | def __init__(self, event): |
| 27 | threading.Thread.__init__(self) |
| 28 | self.event = event |
| 29 | self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) |
Serhiy Storchaka | 1699491 | 2020-04-25 10:06:29 +0300 | [diff] [blame] | 30 | self.port = socket_helper.bind_port(self.sock) |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 31 | # This will be set if the client wants us to wait before echoing |
| 32 | # data back. |
| 33 | self.start_resend_event = None |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 34 | |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 35 | def run(self): |
| 36 | self.sock.listen() |
| 37 | self.event.set() |
| 38 | conn, client = self.sock.accept() |
| 39 | self.buffer = b"" |
| 40 | # collect data until quit message is seen |
| 41 | while SERVER_QUIT not in self.buffer: |
| 42 | data = conn.recv(1) |
| 43 | if not data: |
| 44 | break |
| 45 | self.buffer = self.buffer + data |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 46 | |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 47 | # remove the SERVER_QUIT message |
| 48 | self.buffer = self.buffer.replace(SERVER_QUIT, b'') |
Collin Winter | 8641c56 | 2010-03-17 23:49:15 +0000 | [diff] [blame] | 49 | |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 50 | if self.start_resend_event: |
| 51 | self.start_resend_event.wait() |
| 52 | |
| 53 | # re-send entire set of collected data |
| 54 | try: |
| 55 | # this may fail on some tests, such as test_close_when_done, |
| 56 | # since the client closes the channel when it's done sending |
| 57 | while self.buffer: |
| 58 | n = conn.send(self.buffer[:self.chunk_size]) |
| 59 | time.sleep(0.001) |
| 60 | self.buffer = self.buffer[n:] |
| 61 | except: |
| 62 | pass |
| 63 | |
| 64 | conn.close() |
| 65 | self.sock.close() |
| 66 | |
| 67 | class echo_client(asynchat.async_chat): |
| 68 | |
| 69 | def __init__(self, terminator, server_port): |
| 70 | asynchat.async_chat.__init__(self) |
| 71 | self.contents = [] |
| 72 | self.create_socket(socket.AF_INET, socket.SOCK_STREAM) |
| 73 | self.connect((HOST, server_port)) |
| 74 | self.set_terminator(terminator) |
| 75 | self.buffer = b"" |
| 76 | |
Adam Johnson | 892221b | 2019-11-19 19:45:20 +0000 | [diff] [blame] | 77 | def handle_connect(self): |
| 78 | pass |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 79 | |
Adam Johnson | 892221b | 2019-11-19 19:45:20 +0000 | [diff] [blame] | 80 | if sys.platform == 'darwin': |
| 81 | # select.poll returns a select.POLLHUP at the end of the tests |
| 82 | # on darwin, so just ignore it |
| 83 | def handle_expt(self): |
| 84 | pass |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 85 | |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 86 | def collect_incoming_data(self, data): |
| 87 | self.buffer += data |
Guido van Rossum | 6617252 | 2001-04-06 16:32:22 +0000 | [diff] [blame] | 88 | |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 89 | def found_terminator(self): |
| 90 | self.contents.append(self.buffer) |
| 91 | self.buffer = b"" |
Guido van Rossum | 6617252 | 2001-04-06 16:32:22 +0000 | [diff] [blame] | 92 | |
Antoine Pitrou | a6a4dc8 | 2017-09-07 18:56:24 +0200 | [diff] [blame] | 93 | def start_echo_server(): |
| 94 | event = threading.Event() |
| 95 | s = echo_server(event) |
| 96 | s.start() |
| 97 | event.wait() |
| 98 | event.clear() |
| 99 | time.sleep(0.01) # Give server time to start accepting. |
| 100 | return s, event |
Guido van Rossum | 6617252 | 2001-04-06 16:32:22 +0000 | [diff] [blame] | 101 | |
Guido van Rossum | 6617252 | 2001-04-06 16:32:22 +0000 | [diff] [blame] | 102 | |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 103 | class TestAsynchat(unittest.TestCase): |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 104 | usepoll = False |
| 105 | |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 106 | def setUp(self): |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 107 | self._threads = threading_helper.threading_setup() |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 108 | |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 109 | def tearDown(self): |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 110 | threading_helper.threading_cleanup(*self._threads) |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 111 | |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 112 | def line_terminator_check(self, term, server_chunk): |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 113 | event = threading.Event() |
| 114 | s = echo_server(event) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 115 | s.chunk_size = server_chunk |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 116 | s.start() |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 117 | event.wait() |
| 118 | event.clear() |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 119 | time.sleep(0.01) # Give server time to start accepting. |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 120 | c = echo_client(term, s.port) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 121 | c.push(b"hello ") |
Josiah Carlson | d74900e | 2008-07-07 04:15:08 +0000 | [diff] [blame] | 122 | c.push(b"world" + term) |
| 123 | c.push(b"I'm not dead yet!" + term) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 124 | c.push(SERVER_QUIT) |
| 125 | asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 126 | threading_helper.join_thread(s) |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 127 | |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 128 | self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"]) |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 129 | |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 130 | # the line terminator tests below check receiving variously-sized |
| 131 | # chunks back from the server in order to exercise all branches of |
| 132 | # async_chat.handle_read |
| 133 | |
| 134 | def test_line_terminator1(self): |
| 135 | # test one-character terminator |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 136 | for l in (1, 2, 3): |
Josiah Carlson | d74900e | 2008-07-07 04:15:08 +0000 | [diff] [blame] | 137 | self.line_terminator_check(b'\n', l) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 138 | |
| 139 | def test_line_terminator2(self): |
| 140 | # test two-character terminator |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 141 | for l in (1, 2, 3): |
Josiah Carlson | d74900e | 2008-07-07 04:15:08 +0000 | [diff] [blame] | 142 | self.line_terminator_check(b'\r\n', l) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 143 | |
| 144 | def test_line_terminator3(self): |
| 145 | # test three-character terminator |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 146 | for l in (1, 2, 3): |
Josiah Carlson | d74900e | 2008-07-07 04:15:08 +0000 | [diff] [blame] | 147 | self.line_terminator_check(b'qqq', l) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 148 | |
| 149 | def numeric_terminator_check(self, termlen): |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 150 | # Try reading a fixed number of bytes |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 151 | s, event = start_echo_server() |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 152 | c = echo_client(termlen, s.port) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 153 | data = b"hello world, I'm not dead yet!\n" |
| 154 | c.push(data) |
| 155 | c.push(SERVER_QUIT) |
| 156 | asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 157 | threading_helper.join_thread(s) |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 158 | |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 159 | self.assertEqual(c.contents, [data[:termlen]]) |
| 160 | |
| 161 | def test_numeric_terminator1(self): |
| 162 | # check that ints & longs both work (since type is |
| 163 | # explicitly checked in async_chat.handle_read) |
| 164 | self.numeric_terminator_check(1) |
| 165 | |
| 166 | def test_numeric_terminator2(self): |
| 167 | self.numeric_terminator_check(6) |
| 168 | |
| 169 | def test_none_terminator(self): |
| 170 | # Try reading a fixed number of bytes |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 171 | s, event = start_echo_server() |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 172 | c = echo_client(None, s.port) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 173 | data = b"hello world, I'm not dead yet!\n" |
| 174 | c.push(data) |
| 175 | c.push(SERVER_QUIT) |
| 176 | asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 177 | threading_helper.join_thread(s) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 178 | |
| 179 | self.assertEqual(c.contents, []) |
| 180 | self.assertEqual(c.buffer, data) |
| 181 | |
| 182 | def test_simple_producer(self): |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 183 | s, event = start_echo_server() |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 184 | c = echo_client(b'\n', s.port) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 185 | data = b"hello world\nI'm not dead yet!\n" |
| 186 | p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) |
| 187 | c.push_with_producer(p) |
| 188 | asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 189 | threading_helper.join_thread(s) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 190 | |
| 191 | self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"]) |
| 192 | |
| 193 | def test_string_producer(self): |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 194 | s, event = start_echo_server() |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 195 | c = echo_client(b'\n', s.port) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 196 | data = b"hello world\nI'm not dead yet!\n" |
| 197 | c.push_with_producer(data+SERVER_QUIT) |
| 198 | asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 199 | threading_helper.join_thread(s) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 200 | |
| 201 | self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"]) |
| 202 | |
| 203 | def test_empty_line(self): |
| 204 | # checks that empty lines are handled correctly |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 205 | s, event = start_echo_server() |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 206 | c = echo_client(b'\n', s.port) |
Josiah Carlson | d74900e | 2008-07-07 04:15:08 +0000 | [diff] [blame] | 207 | c.push(b"hello world\n\nI'm not dead yet!\n") |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 208 | c.push(SERVER_QUIT) |
| 209 | asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 210 | threading_helper.join_thread(s) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 211 | |
| 212 | self.assertEqual(c.contents, |
| 213 | [b"hello world", b"", b"I'm not dead yet!"]) |
| 214 | |
| 215 | def test_close_when_done(self): |
Christian Heimes | af98da1 | 2008-01-27 15:18:18 +0000 | [diff] [blame] | 216 | s, event = start_echo_server() |
Collin Winter | 8641c56 | 2010-03-17 23:49:15 +0000 | [diff] [blame] | 217 | s.start_resend_event = threading.Event() |
Christian Heimes | 5e69685 | 2008-04-09 08:37:03 +0000 | [diff] [blame] | 218 | c = echo_client(b'\n', s.port) |
Josiah Carlson | d74900e | 2008-07-07 04:15:08 +0000 | [diff] [blame] | 219 | c.push(b"hello world\nI'm not dead yet!\n") |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 220 | c.push(SERVER_QUIT) |
| 221 | c.close_when_done() |
| 222 | asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) |
Collin Winter | 8641c56 | 2010-03-17 23:49:15 +0000 | [diff] [blame] | 223 | |
| 224 | # Only allow the server to start echoing data back to the client after |
| 225 | # the client has closed its connection. This prevents a race condition |
| 226 | # where the server echoes all of its data before we can check that it |
| 227 | # got any down below. |
| 228 | s.start_resend_event.set() |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 229 | threading_helper.join_thread(s) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 230 | |
| 231 | self.assertEqual(c.contents, []) |
| 232 | # the server might have been able to send a byte or two back, but this |
| 233 | # at least checks that it received something and didn't just fail |
| 234 | # (which could still result in the client not having received anything) |
Alexandre Vassalotti | 953f558 | 2009-07-22 21:29:01 +0000 | [diff] [blame] | 235 | self.assertGreater(len(s.buffer), 0) |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 236 | |
Victor Stinner | d9e810a | 2014-07-08 00:00:30 +0200 | [diff] [blame] | 237 | def test_push(self): |
| 238 | # Issue #12523: push() should raise a TypeError if it doesn't get |
| 239 | # a bytes string |
| 240 | s, event = start_echo_server() |
| 241 | c = echo_client(b'\n', s.port) |
| 242 | data = b'bytes\n' |
| 243 | c.push(data) |
| 244 | c.push(bytearray(data)) |
| 245 | c.push(memoryview(data)) |
| 246 | self.assertRaises(TypeError, c.push, 10) |
| 247 | self.assertRaises(TypeError, c.push, 'unicode') |
| 248 | c.push(SERVER_QUIT) |
| 249 | asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) |
Hai Shi | e80697d | 2020-05-28 06:10:27 +0800 | [diff] [blame] | 250 | threading_helper.join_thread(s) |
Victor Stinner | d9e810a | 2014-07-08 00:00:30 +0200 | [diff] [blame] | 251 | self.assertEqual(c.contents, [b'bytes', b'bytes', b'bytes']) |
| 252 | |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 253 | |
| 254 | class TestAsynchat_WithPoll(TestAsynchat): |
| 255 | usepoll = True |
| 256 | |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 257 | |
Victor Stinner | 45cff66 | 2014-07-24 18:49:36 +0200 | [diff] [blame] | 258 | class TestAsynchatMocked(unittest.TestCase): |
| 259 | def test_blockingioerror(self): |
| 260 | # Issue #16133: handle_read() must ignore BlockingIOError |
| 261 | sock = unittest.mock.Mock() |
| 262 | sock.recv.side_effect = BlockingIOError(errno.EAGAIN) |
| 263 | |
| 264 | dispatcher = asynchat.async_chat() |
| 265 | dispatcher.set_socket(sock) |
| 266 | self.addCleanup(dispatcher.del_channel) |
| 267 | |
| 268 | with unittest.mock.patch.object(dispatcher, 'handle_error') as error: |
| 269 | dispatcher.handle_read() |
| 270 | self.assertFalse(error.called) |
| 271 | |
| 272 | |
Guido van Rossum | 806c246 | 2007-08-06 23:33:07 +0000 | [diff] [blame] | 273 | class TestHelperFunctions(unittest.TestCase): |
| 274 | def test_find_prefix_at_end(self): |
| 275 | self.assertEqual(asynchat.find_prefix_at_end("qwerty\r", "\r\n"), 1) |
| 276 | self.assertEqual(asynchat.find_prefix_at_end("qwertydkjf", "\r\n"), 0) |
| 277 | |
Victor Stinner | fd5d1b5 | 2014-07-08 00:16:54 +0200 | [diff] [blame] | 278 | |
Victor Stinner | 630a4f6 | 2014-07-08 00:26:36 +0200 | [diff] [blame] | 279 | class TestNotConnected(unittest.TestCase): |
| 280 | def test_disallow_negative_terminator(self): |
| 281 | # Issue #11259 |
| 282 | client = asynchat.async_chat() |
| 283 | self.assertRaises(ValueError, client.set_terminator, -1) |
| 284 | |
| 285 | |
| 286 | |
Andrew M. Kuchling | 5ac2534 | 2005-06-09 14:56:31 +0000 | [diff] [blame] | 287 | if __name__ == "__main__": |
Brett Cannon | 3e9a9ae | 2013-06-12 21:25:59 -0400 | [diff] [blame] | 288 | unittest.main() |