Anonymous committed 5235ae9

Made a unit test more thorough and self-explanatory. Updated a comment.

Comments (0)

Files changed (2)


         self.assertEquals(o.multiple.level2.level3.keyB, 9.999)
     if hasattr(objc.runtime.NSObject, "willChangeValueForKey_"):
-        # We're on a system that supports KeyValueCoding observations
-        # AFAIK this is on MacOS X from 10.3
+        # NSKeyValueObserving is only available on Panther and beyond
         def testKVO1(self):
             o = KVOClass.alloc().init()
             o.addObserver_forKeyPath_options_context_(self, "test", 0, 0)


         o = KeyValueClass7.alloc().init()
         self.assertRaises(KeyError, getKey, o, "private")
-    def testValueForKey(self):
+    def testArrayValueForKey(self):
         o = KeyValueClass7.alloc().init()
         a = objc.runtime.NSMutableArray.array()
-        b = objc.runtime.NSMutableArray.arrayWithObject_("m")
+        a.addObject_({"keyM": "5"})
+        a.addObject_(objc.runtime.NSDictionary.dictionaryWithObject_forKey_("foo", "keyM"))
+        b = objc.runtime.NSMutableArray.arrayWithObjects_("m","5", "foo", None)
         self.assertEquals(a.valueForKey_("keyM"), b)
         self.assertRaises(KeyError, getKey, o, "nokey")
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.