1b2732e9dSimarom# Copyright (C) PyZMQ Developers
2b2732e9dSimarom# Distributed under the terms of the Modified BSD License.
3b2732e9dSimarom
4b2732e9dSimaromimport sys
5b2732e9dSimaromfrom unittest import TestCase
6b2732e9dSimarom
7b2732e9dSimaromclass TestImports(TestCase):
8b2732e9dSimarom    """Test Imports - the quickest test to ensure that we haven't
9b2732e9dSimarom    introduced version-incompatible syntax errors."""
10b2732e9dSimarom
11b2732e9dSimarom    def test_toplevel(self):
12b2732e9dSimarom        """test toplevel import"""
13b2732e9dSimarom        import zmq
14b2732e9dSimarom
15b2732e9dSimarom    def test_core(self):
16b2732e9dSimarom        """test core imports"""
17b2732e9dSimarom        from zmq import Context
18b2732e9dSimarom        from zmq import Socket
19b2732e9dSimarom        from zmq import Poller
20b2732e9dSimarom        from zmq import Frame
21b2732e9dSimarom        from zmq import constants
22b2732e9dSimarom        from zmq import device, proxy
23b2732e9dSimarom        from zmq import Stopwatch
24b2732e9dSimarom        from zmq import (
25b2732e9dSimarom            zmq_version,
26b2732e9dSimarom            zmq_version_info,
27b2732e9dSimarom            pyzmq_version,
28b2732e9dSimarom            pyzmq_version_info,
29b2732e9dSimarom        )
30b2732e9dSimarom
31b2732e9dSimarom    def test_devices(self):
32b2732e9dSimarom        """test device imports"""
33b2732e9dSimarom        import zmq.devices
34b2732e9dSimarom        from zmq.devices import basedevice
35b2732e9dSimarom        from zmq.devices import monitoredqueue
36b2732e9dSimarom        from zmq.devices import monitoredqueuedevice
37b2732e9dSimarom
38b2732e9dSimarom    def test_log(self):
39b2732e9dSimarom        """test log imports"""
40b2732e9dSimarom        import zmq.log
41b2732e9dSimarom        from zmq.log import handlers
42b2732e9dSimarom
43b2732e9dSimarom    def test_eventloop(self):
44b2732e9dSimarom        """test eventloop imports"""
45b2732e9dSimarom        import zmq.eventloop
46b2732e9dSimarom        from zmq.eventloop import ioloop
47b2732e9dSimarom        from zmq.eventloop import zmqstream
48b2732e9dSimarom        from zmq.eventloop.minitornado.platform import auto
49b2732e9dSimarom        from zmq.eventloop.minitornado import ioloop
50b2732e9dSimarom
51b2732e9dSimarom    def test_utils(self):
52b2732e9dSimarom        """test util imports"""
53b2732e9dSimarom        import zmq.utils
54b2732e9dSimarom        from zmq.utils import strtypes
55b2732e9dSimarom        from zmq.utils import jsonapi
56b2732e9dSimarom
57b2732e9dSimarom    def test_ssh(self):
58b2732e9dSimarom        """test ssh imports"""
59b2732e9dSimarom        from zmq.ssh import tunnel
60b2732e9dSimarom
61b2732e9dSimarom
62b2732e9dSimarom
63