move sections
[python/dscho.git] / Lib / test / test_scriptpackages.py
blob7e02fa02f54351c20c77a42a1388d656abd07efc
1 # Copyright (C) 2003 Python Software Foundation
3 import unittest
4 from test import test_support
6 # Skip this test if aetools does not exist.
7 test_support.import_module('aetools')
9 class TestScriptpackages(unittest.TestCase):
11 def _test_scriptpackage(self, package, testobject=1):
12 # Check that we can import the package
13 mod = __import__(package)
14 # Test that we can get the main event class
15 klass = getattr(mod, package)
16 # Test that we can instantiate that class
17 talker = klass()
18 if testobject:
19 # Test that we can get an application object
20 obj = mod.application(0)
22 def test__builtinSuites(self):
23 self._test_scriptpackage('_builtinSuites', testobject=0)
25 def test_StdSuites(self):
26 self._test_scriptpackage('StdSuites')
28 def test_SystemEvents(self):
29 self._test_scriptpackage('SystemEvents')
31 def test_Finder(self):
32 self._test_scriptpackage('Finder')
34 def test_Terminal(self):
35 self._test_scriptpackage('Terminal')
37 def test_Netscape(self):
38 self._test_scriptpackage('Netscape')
40 def test_Explorer(self):
41 self._test_scriptpackage('Explorer')
43 def test_CodeWarrior(self):
44 self._test_scriptpackage('CodeWarrior')
46 def test_main():
47 test_support.run_unittest(TestScriptpackages)
50 if __name__ == '__main__':
51 test_main()