Bob Ippolito committed 8777035

TEST: [ 1107823 ] Key-Value Observing doesn't work for 'manual' properties

this currently fails:

Comments (0)

Files changed (1)


     def __init__(self):
         self.key3 = 3
         self._key4 = u"4"
+        self._pythonConvention = u'BAD'
+        self._pythonConventionValue = u'GOOD'
         self.__private = u'private'
     def addMultiple(self):
         self.multiple.level2.level3.keyA = u"hello"
         self.multiple.level2.level3.keyB = u"world"
+    def pythonConvention(self):
+        return self._pythonConventionValue
+    def setPythonConvention_(self, value):
+        self._pythonConventionValue = value
     def getKey1(self):
         return 1
         self.assertEquals(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, u"key3"), 3)
         self.assertEquals(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, u"key4"), u"4")
         self.assertEquals(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, u"multiple"), o.multiple)
+        self.assertEquals(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, u"pythonConvention"), u'GOOD')
         self.assertRaises(KeyError, STUB.keyValue_forObject_key_, DO_VALUEFORKEY, o, u"nokey")
     # 'takeValue:forKey: u', test these as wel.
     class PyKeyValueCoding_10_3 (unittest.TestCase):
+        def testPythonConvention(self):
+            o = KeyValueClass2()
+            self.assertEquals(o._pythonConvention, u'BAD')
+            self.assertEquals(o.pythonConvention(), u'GOOD')
+            self.assertEquals(o._pythonConventionValue, u'GOOD')
+            self.assertEquals(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, u"pythonConvention"), u'GOOD')
+            STUB.setKeyValue_forObject_key_value_(DO_SETVALUE_FORKEY, o, u'pythonConvention', u'CHANGED')
+            self.assertEquals(STUB.keyValue_forObject_key_(DO_VALUEFORKEY, o, u"pythonConvention"), u'CHANGED')
+            self.assertEquals(o._pythonConvention, u'BAD')
+            self.assertEquals(o.pythonConvention(), u'CHANGED')
+            self.assertEquals(o._pythonConventionValue, u'CHANGED')
         def testSetValueForKey(self):
             o = KeyValueClass2()
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.