Пример #1
0
    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)
Пример #2
0
    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)
Пример #3
0
 def test_error_message(self):
     try:
         GIMarshallingTests.gerror()
     except GLib.GError as e:
         self.assertTrue("gi-marshalling-tests-gerror-message" in str(e))
Пример #4
0
 def test_error_message(self):
     try:
         GIMarshallingTests.gerror()
     except GLib.GError as e:
         self.assertTrue("gi-marshalling-tests-gerror-message" in str(e))