OLD | NEW |
| (Empty) |
1 | |
2 # Copyright (c) 2001-2004 Twisted Matrix Laboratories. | |
3 # See LICENSE for details. | |
4 | |
5 | |
6 from twisted.trial import unittest | |
7 from twisted.python.runtime import platformType | |
8 | |
9 class AtLeastImportTestCase(unittest.TestCase): | |
10 | |
11 """I test that there are no syntax errors which will not allow importing. | |
12 """ | |
13 | |
14 failureException = ImportError | |
15 | |
16 def test_misc(self): | |
17 """Test importing other misc. modules | |
18 """ | |
19 from twisted import copyright | |
20 | |
21 def test_persisted(self): | |
22 """Test importing persisted | |
23 """ | |
24 from twisted.persisted import dirdbm | |
25 from twisted.persisted import styles | |
26 | |
27 def test_internet(self): | |
28 """Test importing internet | |
29 """ | |
30 from twisted.internet import tcp | |
31 from twisted.internet import main | |
32 # from twisted.internet import ssl | |
33 from twisted.internet import abstract | |
34 from twisted.internet import udp | |
35 from twisted.internet import protocol | |
36 from twisted.internet import defer | |
37 | |
38 def test_unix(self): | |
39 """internet modules for unix.""" | |
40 from twisted.internet import stdio | |
41 from twisted.internet import process | |
42 from twisted.internet import unix | |
43 | |
44 if platformType != "posix": | |
45 test_unix.skip = "UNIX-only modules" | |
46 | |
47 def test_spread(self): | |
48 """Test importing spreadables | |
49 """ | |
50 from twisted.spread import pb | |
51 from twisted.spread import jelly | |
52 from twisted.spread import banana | |
53 from twisted.spread import flavors | |
54 | |
55 def test_twistedPython(self): | |
56 """Test importing twisted.python | |
57 """ | |
58 from twisted.python import hook | |
59 from twisted.python import log | |
60 from twisted.python import reflect | |
61 # from twisted.python import threadable | |
62 # from twisted.python import threadpool | |
63 from twisted.python import usage | |
64 from twisted.python import otp | |
65 | |
66 def test_protocols(self): | |
67 """Test importing protocols | |
68 """ | |
69 from twisted.protocols import basic | |
70 from twisted.protocols import ftp | |
71 from twisted.protocols import telnet | |
72 from twisted.protocols import policies | |
73 | |
74 def test_enterprise(self): | |
75 from twisted.enterprise import adbapi | |
76 from twisted.enterprise import reflector | |
77 from twisted.enterprise import sqlreflector | |
78 from twisted.enterprise import row | |
79 | |
80 def test_test(self): | |
81 import os, sys | |
82 oldargv = sys.argv | |
83 sys.argv = sys.argv[:1] | |
84 try: | |
85 tests = os.listdir(os.path.dirname(__file__)) | |
86 for f in tests: | |
87 if f.startswith('test_') and f.endswith('.py'): | |
88 __import__('twisted.test.%s' % f[:-3]) | |
89 finally: | |
90 sys.argv = oldargv | |
91 | |
92 testCases = [AtLeastImportTestCase] | |
OLD | NEW |