def test_exception(self): with self.assertRaises(GLib.Error) as context: GIMarshallingTests.gerror() e = context.exception self.assertEqual(e.domain, GIMarshallingTests.CONSTANT_GERROR_DOMAIN) self.assertEqual(e.code, GIMarshallingTests.CONSTANT_GERROR_CODE) self.assertEqual(e.message, GIMarshallingTests.CONSTANT_GERROR_MESSAGE)
def test_error_message(self): try: GIMarshallingTests.gerror() except GLib.GError as e: self.assertTrue("gi-marshalling-tests-gerror-message" in str(e))