PyXR

c:\python24\lib \ test \ test_scriptpackages.py



0001 # Copyright (C) 2003 Python Software Foundation
0002 
0003 import unittest
0004 import os
0005 import sys
0006 import tempfile
0007 from test import test_support
0008 import aetools
0009 
0010 class TestScriptpackages(unittest.TestCase):
0011 
0012     def _test_scriptpackage(self, package, testobject=1):
0013         # Check that we can import the package
0014         mod = __import__(package)
0015         # Test that we can get the main event class
0016         klass = getattr(mod, package)
0017         # Test that we can instantiate that class
0018         talker = klass()
0019         if testobject:
0020             # Test that we can get an application object
0021             obj = mod.application(0)
0022 
0023     def test__builtinSuites(self):
0024         self._test_scriptpackage('_builtinSuites', testobject=0)
0025 
0026     def test_StdSuites(self):
0027         self._test_scriptpackage('StdSuites')
0028 
0029     def test_SystemEvents(self):
0030         self._test_scriptpackage('SystemEvents')
0031 
0032     def test_Finder(self):
0033         self._test_scriptpackage('Finder')
0034 
0035     def test_Terminal(self):
0036         self._test_scriptpackage('Terminal')
0037 
0038     def test_Netscape(self):
0039         self._test_scriptpackage('Netscape')
0040 
0041     def test_Explorer(self):
0042         self._test_scriptpackage('Explorer')
0043 
0044     def test_CodeWarrior(self):
0045         self._test_scriptpackage('CodeWarrior')
0046 
0047 def test_main():
0048     test_support.run_unittest(TestScriptpackages)
0049 
0050 
0051 if __name__ == '__main__':
0052     test_main()
0053 

Generated by PyXR 0.9.4
SourceForge.net Logo