summaryrefslogtreecommitdiffstats
path: root/tests/test_properties.py
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2007-05-02 00:12:31 +0000
committerJohan Dahlin <johan@src.gnome.org>2007-05-02 00:12:31 +0000
commit784da2ea28089d662f7ab122ba401b66953c52f4 (patch)
tree29cebb12a6fa363ef366da59f7c4da8681c29dfe /tests/test_properties.py
parent4ddb6f3b99d4b98eb81eb6e0940aba48b5841947 (diff)
downloadpygobject-784da2ea28089d662f7ab122ba401b66953c52f4.tar.gz
pygobject-784da2ea28089d662f7ab122ba401b66953c52f4.tar.xz
pygobject-784da2ea28089d662f7ab122ba401b66953c52f4.zip
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
Diffstat (limited to 'tests/test_properties.py')
-rw-r--r--tests/test_properties.py12
1 files changed, 12 insertions, 0 deletions
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')