symbian-qemu-0.9.1-12/python-2.6.1/Lib/test/test_scriptpackages.py
changeset 1 2fb8b9db1c86
equal deleted inserted replaced
0:ffa851df0825 1:2fb8b9db1c86
       
     1 # Copyright (C) 2003 Python Software Foundation
       
     2 
       
     3 import unittest
       
     4 from test import test_support
       
     5 import aetools
       
     6 
       
     7 class TestScriptpackages(unittest.TestCase):
       
     8 
       
     9     def _test_scriptpackage(self, package, testobject=1):
       
    10         # Check that we can import the package
       
    11         mod = __import__(package)
       
    12         # Test that we can get the main event class
       
    13         klass = getattr(mod, package)
       
    14         # Test that we can instantiate that class
       
    15         talker = klass()
       
    16         if testobject:
       
    17             # Test that we can get an application object
       
    18             obj = mod.application(0)
       
    19 
       
    20     def test__builtinSuites(self):
       
    21         self._test_scriptpackage('_builtinSuites', testobject=0)
       
    22 
       
    23     def test_StdSuites(self):
       
    24         self._test_scriptpackage('StdSuites')
       
    25 
       
    26     def test_SystemEvents(self):
       
    27         self._test_scriptpackage('SystemEvents')
       
    28 
       
    29     def test_Finder(self):
       
    30         self._test_scriptpackage('Finder')
       
    31 
       
    32     def test_Terminal(self):
       
    33         self._test_scriptpackage('Terminal')
       
    34 
       
    35     def test_Netscape(self):
       
    36         self._test_scriptpackage('Netscape')
       
    37 
       
    38     def test_Explorer(self):
       
    39         self._test_scriptpackage('Explorer')
       
    40 
       
    41     def test_CodeWarrior(self):
       
    42         self._test_scriptpackage('CodeWarrior')
       
    43 
       
    44 def test_main():
       
    45     test_support.run_unittest(TestScriptpackages)
       
    46 
       
    47 
       
    48 if __name__ == '__main__':
       
    49     test_main()