home *** CD-ROM | disk | FTP | other *** search
/ PC World 2005 June / PCWorld_2005-06_cd.bin / software / vyzkuste / firewally / firewally.exe / framework-2.3.exe / test_scriptpackages.py < prev    next >
Text File  |  2003-12-30  |  1KB  |  53 lines

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