Example #1
0
 def test_struct_opaque(self):
     # we should get a sensible error message
     try:
         Everything.TestBoxedPrivate()
         self.fail('allocating disguised struct without default constructor unexpectedly succeeded')
     except TypeError:
         (e_type, e_value, e_tb) = sys.exc_info()
         self.assertEqual(e_type, TypeError)
         self.assertTrue('TestBoxedPrivate' in str(e_value), str(e_value))
         self.assertTrue('constructor' in str(e_value), str(e_value))
         tb = ''.join(traceback.format_exception(e_type, e_value, e_tb))
         self.assertTrue('tests/test_everything.py", line' in tb, tb)