diff options
author | 2015-09-08 18:41:17 -0400 | |
---|---|---|
committer | 2015-09-08 18:41:17 -0400 | |
commit | 60e901aabaeab7d205da65030849056c05c8b73e (patch) | |
tree | 20883ed8ae63c326f3c042992e8dbe668656568e /scripts/external_libs/zmq/tests/test_zmqstream.py | |
parent | 9a524989d331f04abecd3faa72d98157a8651739 (diff) | |
parent | 463cb7c212e927a732fb5b702a288a06550c5eb8 (diff) |
Merge remote-tracking branch
Conflicts:
linux/b
linux/ws_main.py
linux_dpdk/ws_main.py
src/bp_sim.h
Diffstat (limited to 'scripts/external_libs/zmq/tests/test_zmqstream.py')
-rw-r--r-- | scripts/external_libs/zmq/tests/test_zmqstream.py | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/scripts/external_libs/zmq/tests/test_zmqstream.py b/scripts/external_libs/zmq/tests/test_zmqstream.py new file mode 100644 index 00000000..cdb3a171 --- /dev/null +++ b/scripts/external_libs/zmq/tests/test_zmqstream.py @@ -0,0 +1,34 @@ +# -*- coding: utf8 -*- +# Copyright (C) PyZMQ Developers +# Distributed under the terms of the Modified BSD License. + + +import sys +import time + +from unittest import TestCase + +import zmq +from zmq.eventloop import ioloop, zmqstream + +class TestZMQStream(TestCase): + + def setUp(self): + self.context = zmq.Context() + self.socket = self.context.socket(zmq.REP) + self.loop = ioloop.IOLoop.instance() + self.stream = zmqstream.ZMQStream(self.socket) + + def tearDown(self): + self.socket.close() + self.context.term() + + def test_callable_check(self): + """Ensure callable check works (py3k).""" + + self.stream.on_send(lambda *args: None) + self.stream.on_recv(lambda *args: None) + self.assertRaises(AssertionError, self.stream.on_recv, 1) + self.assertRaises(AssertionError, self.stream.on_send, 1) + self.assertRaises(AssertionError, self.stream.on_recv, zmq) + |