[pygobject] Fix tests to work with g-i 1.34.2



commit 05d767a602571805e80099f1db47ad4164575c53
Author: Martin Pitt <martinpitt gnome org>
Date:   Thu Nov 29 13:30:56 2012 +0100

    Fix tests to work with g-i 1.34.2
    
    Do not try to call GIMarshallingTests API which isn't present when running
    against g-i 1.34.2. This can be dropped when the g-i dependency gets bumped to
    1.35.x.

 tests/test_gi.py |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/tests/test_gi.py b/tests/test_gi.py
index 0be7904..0ee683c 100644
--- a/tests/test_gi.py
+++ b/tests/test_gi.py
@@ -1981,9 +1981,11 @@ class TestPythonGObject(unittest.TestCase):
         self.assertEqual(object_.val, 84)
         self.assertEqual(object_.method_int8_out(), 42)
 
-        self.assertEqual(object_.method_int8_arg_and_out_caller(42), 43)
-        self.assertEqual(object_.method_int8_arg_and_out_callee(42), 43)
-        self.assertEqual(object_.method_str_arg_out_ret('hello'), ('HELLO', 5))
+        # can be dropped when bumping g-i dependencies to >= 1.35.2
+        if hasattr(object_, 'method_int8_arg_and_out_caller'):
+            self.assertEqual(object_.method_int8_arg_and_out_caller(42), 43)
+            self.assertEqual(object_.method_int8_arg_and_out_callee(42), 43)
+            self.assertEqual(object_.method_str_arg_out_ret('hello'), ('HELLO', 5))
 
         object_.method_with_default_implementation(42)
         self.assertEqual(object_.props.int, 84)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]