Imported Upstream version 12.1.0
[contrib/python-twisted.git] / twisted / test / test_import.py
1 # Copyright (c) Twisted Matrix Laboratories.
2 # See LICENSE for details.
3
4 from twisted.trial import unittest
5 from twisted.python.runtime import platformType
6
7
8 class AtLeastImportTestCase(unittest.TestCase):
9     """
10     I test that there are no syntax errors which will not allow importing.
11     """
12
13     failureException = ImportError
14
15     def test_misc(self):
16         """
17         Test importing other miscellaneous modules.
18         """
19         from twisted import copyright
20
21     def test_persisted(self):
22         """
23         Test importing persisted.
24         """
25         from twisted.persisted import dirdbm
26         from twisted.persisted import styles
27
28     def test_internet(self):
29         """
30         Test importing internet.
31         """
32         from twisted.internet import tcp
33         from twisted.internet import main   
34         from twisted.internet import abstract
35         from twisted.internet import udp
36         from twisted.internet import protocol
37         from twisted.internet import defer
38
39     def test_unix(self):
40         """
41         Test internet modules for unix.
42         """
43         from twisted.internet import stdio
44         from twisted.internet import process
45         from twisted.internet import unix
46
47     if platformType != "posix":
48         test_unix.skip = "UNIX-only modules"
49
50     def test_spread(self):
51         """
52         Test importing spreadables.
53         """
54         from twisted.spread import pb
55         from twisted.spread import jelly
56         from twisted.spread import banana
57         from twisted.spread import flavors
58
59     def test_twistedPython(self):
60         """
61         Test importing C{twisted.python}.
62         """
63         from twisted.python import hook
64         from twisted.python import log
65         from twisted.python import reflect
66         from twisted.python import usage
67
68     def test_protocols(self):
69         """
70         Test importing protocols.
71         """
72         from twisted.protocols import basic
73         from twisted.protocols import ftp
74         from twisted.protocols import telnet
75         from twisted.protocols import policies