home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2011 February / maximum-cd-2011-02.iso / DiscContents / digsby_setup85.exe / lib / tests / digsby_unittest.pyo (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2010-11-24  |  2.0 KB  |  70 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.6)
  3.  
  4. import wx
  5. import unittest
  6.  
  7. try:
  8.     _
  9. except NameError:
  10.     import gettext
  11.     gettext.install('Digsby')
  12.  
  13. if getattr(wx, 'WXPY', False):
  14.     wx.WindowClass = wx._Window
  15. else:
  16.     wx.WindowClass = wx.Window
  17.  
  18. try:
  19.     sentinel
  20. except NameError:
  21.     import bootstrap
  22.     bootstrap.install_sentinel()
  23.  
  24.  
  25. class TestCase(unittest.TestCase):
  26.     
  27.     def setUp(self):
  28.         if wx.GetApp() is None:
  29.             self._init_once()
  30.         
  31.  
  32.     
  33.     def _init_once(self):
  34.         global app
  35.         testapp = testapp
  36.         import tests.testapp
  37.         app = testapp()
  38.  
  39.     
  40.     def run(self, result = None):
  41.         if result is None:
  42.             self.result = self.defaultTestResult()
  43.         else:
  44.             self.result = result
  45.         return unittest.TestCase.run(self, result)
  46.  
  47.     
  48.     def expect(self, val, msg = None):
  49.         
  50.         try:
  51.             self.assert_(val, msg)
  52.         except:
  53.             self.result.addFailure(self, self._exc_info())
  54.  
  55.  
  56.     
  57.     def expectEqual(self, first, second, msg = None):
  58.         
  59.         try:
  60.             self.failUnlessEqual(first, second, msg)
  61.         except:
  62.             self.result.addFailure(self, self._exc_info())
  63.  
  64.  
  65.     expect_equal = expectEqual
  66.     assert_equal = unittest.TestCase.assertEqual
  67.     assert_raises = unittest.TestCase.assertRaises
  68.  
  69. test_main = unittest.main
  70.