Commits

Bill Bumgarner  committed 5235ae9

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

  • Participants
  • Parent commits cc8fac9

Comments (0)

Files changed (2)

File pyobjc/Lib/Foundation/test/test_keyvalue.py

         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)

File pyobjc/Lib/PyObjCTools/test/test_keyvalue.py

         o = KeyValueClass7.alloc().init()
         self.assertRaises(KeyError, getKey, o, "private")
 
-    def testValueForKey(self):
+    def testArrayValueForKey(self):
         o = KeyValueClass7.alloc().init()
         o.addMultiple()
 
 
         a = objc.runtime.NSMutableArray.array()
         a.addObject_(o)
-        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")