diff options
Diffstat (limited to 'tests/test_object_marshaling.py')
-rw-r--r-- | tests/test_object_marshaling.py | 68 |
1 files changed, 0 insertions, 68 deletions
diff --git a/tests/test_object_marshaling.py b/tests/test_object_marshaling.py index ae0727e..c881a9a 100644 --- a/tests/test_object_marshaling.py +++ b/tests/test_object_marshaling.py @@ -540,74 +540,6 @@ class TestVFuncsWithHeldFloatingArg(unittest.TestCase): self.assertTrue(held_object_ref() is None) -class TestPropertyHoldingObject(unittest.TestCase): - def test_props_getter_holding_object_ref_count(self): - holder = GIMarshallingTests.PropertiesObject() - held = GObject.Object() - - self.assertEqual(holder.__grefcount__, 1) - self.assertEqual(held.__grefcount__, 1) - - holder.set_property('some-object', held) - self.assertEqual(holder.__grefcount__, 1) - - initial_ref_count = held.__grefcount__ - holder.props.some_object - gc.collect() - self.assertEqual(held.__grefcount__, initial_ref_count) - - def test_get_property_holding_object_ref_count(self): - holder = GIMarshallingTests.PropertiesObject() - held = GObject.Object() - - self.assertEqual(holder.__grefcount__, 1) - self.assertEqual(held.__grefcount__, 1) - - holder.set_property('some-object', held) - self.assertEqual(holder.__grefcount__, 1) - - initial_ref_count = held.__grefcount__ - holder.get_property('some-object') - gc.collect() - self.assertEqual(held.__grefcount__, initial_ref_count) - - def test_props_setter_holding_object_ref_count(self): - holder = GIMarshallingTests.PropertiesObject() - held = GObject.Object() - - self.assertEqual(holder.__grefcount__, 1) - self.assertEqual(held.__grefcount__, 1) - - # Setting property should only increase ref count by 1 - holder.props.some_object = held - self.assertEqual(holder.__grefcount__, 1) - self.assertEqual(held.__grefcount__, 2) - - # Clearing should pull it back down - holder.props.some_object = None - self.assertEqual(held.__grefcount__, 1) - - def test_set_property_holding_object_ref_count(self): - holder = GIMarshallingTests.PropertiesObject() - held = GObject.Object() - - self.assertEqual(holder.__grefcount__, 1) - self.assertEqual(held.__grefcount__, 1) - - # Setting property should only increase ref count by 1 - holder.set_property('some-object', held) - self.assertEqual(holder.__grefcount__, 1) - self.assertEqual(held.__grefcount__, 2) - - # Clearing should pull it back down - holder.set_property('some-object', None) - self.assertEqual(held.__grefcount__, 1) - - def test_set_object_property_to_invalid_type(self): - obj = GIMarshallingTests.PropertiesObject() - self.assertRaises(TypeError, obj.set_property, 'some-object', 'not_an_object') - - @unittest.skipIf(Regress is None, 'Regress is required') class TestArgumentTypeErrors(unittest.TestCase): def test_object_argument_type_error(self): |