From 784da2ea28089d662f7ab122ba401b66953c52f4 Mon Sep 17 00:00:00 2001 From: Johan Dahlin Date: Wed, 2 May 2007 00:12:31 +0000 Subject: Store property values in the descriptor per instance, add a test. * gobject/propertyhelper.py: * tests/test_properties.py: Store property values in the descriptor per instance, add a test. svn path=/trunk/; revision=665 --- tests/test_properties.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tests') diff --git a/tests/test_properties.py b/tests/test_properties.py index 423a8f6..3996b8d 100644 --- a/tests/test_properties.py +++ b/tests/test_properties.py @@ -278,3 +278,15 @@ class TestProperty(unittest.TestCase): self.assertRaises(TypeError, gobject.property, type=gtype, minimum=min, maximum=max+1) + + def testMultipleInstances(self): + class C(gobject.GObject): + prop = gobject.property(type=str, default='default') + + o1 = C() + o2 = C() + self.assertEqual(o1.prop, 'default') + self.assertEqual(o2.prop, 'default') + o1.prop = 'value' + self.assertEqual(o1.prop, 'value') + self.assertEqual(o2.prop, 'default') -- cgit