Python asynchat.simple_producer() Examples
The following are 7
code examples of asynchat.simple_producer().
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example.
You may also want to check out all available functions/classes of the module
asynchat
, or try the search function
.
Example #1
Source File: test_asynchat.py From ironpython2 with Apache License 2.0 | 5 votes |
def test_simple_producer(self): s, event = start_echo_server() c = echo_client('\n', s.port) data = "hello world\nI'm not dead yet!\n" p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) s.join() self.assertEqual(c.contents, ["hello world", "I'm not dead yet!"])
Example #2
Source File: test_asynchat.py From BinderFilter with MIT License | 5 votes |
def test_simple_producer(self): s, event = start_echo_server() c = echo_client('\n', s.port) data = "hello world\nI'm not dead yet!\n" p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) s.join() self.assertEqual(c.contents, ["hello world", "I'm not dead yet!"])
Example #3
Source File: test_asynchat.py From oss-ftp with MIT License | 5 votes |
def test_simple_producer(self): s, event = start_echo_server() c = echo_client('\n', s.port) data = "hello world\nI'm not dead yet!\n" p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) s.join() self.assertEqual(c.contents, ["hello world", "I'm not dead yet!"])
Example #4
Source File: test_asynchat.py From Fluid-Designer with GNU General Public License v3.0 | 5 votes |
def test_simple_producer(self): s, event = start_echo_server() c = echo_client(b'\n', s.port) data = b"hello world\nI'm not dead yet!\n" p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) s.join(timeout=TIMEOUT) if s.is_alive(): self.fail("join() timed out") self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"])
Example #5
Source File: test_asynchat.py From ironpython3 with Apache License 2.0 | 5 votes |
def test_simple_producer(self): s, event = start_echo_server() c = echo_client(b'\n', s.port) data = b"hello world\nI'm not dead yet!\n" p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) s.join(timeout=TIMEOUT) if s.is_alive(): self.fail("join() timed out") self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"])
Example #6
Source File: test_asynchat.py From gcblue with BSD 3-Clause "New" or "Revised" License | 5 votes |
def test_simple_producer(self): s, event = start_echo_server() c = echo_client('\n', s.port) data = "hello world\nI'm not dead yet!\n" p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) s.join() self.assertEqual(c.contents, ["hello world", "I'm not dead yet!"])
Example #7
Source File: test_asynchat.py From Project-New-Reign---Nemesis-Main with GNU General Public License v3.0 | 5 votes |
def test_simple_producer(self): s, event = start_echo_server() c = echo_client(b'\n', s.port) data = b"hello world\nI'm not dead yet!\n" p = asynchat.simple_producer(data+SERVER_QUIT, buffer_size=8) c.push_with_producer(p) asyncore.loop(use_poll=self.usepoll, count=300, timeout=.01) s.join(timeout=TIMEOUT) if s.is_alive(): self.fail("join() timed out") self.assertEqual(c.contents, [b"hello world", b"I'm not dead yet!"])