def testObjectEnumerator(self): s = self.setClass(range(10)) enum = OC_TestSet.objectEnumeratorOfSet_(s) l = [] v = enum.nextObject() while v is not None: l.append(v) v = enum.nextObject() self.assertEqual(l, list(range(10))) s = self.setClass([1, 2, None, 3]) enum = OC_TestSet.objectEnumeratorOfSet_(s) l = [] v = enum.nextObject() while v is not None: l.append(v) v = enum.nextObject() self.assertEqual(dict.fromkeys(l), dict.fromkeys([1, 2, NSNull.null(), 3]))
def testObjectEnumerator(self): s = self.setClass(range(10)) enum = OC_TestSet.objectEnumeratorOfSet_(s) l = [] v = enum.nextObject() while v is not None: l.append(v) v = enum.nextObject() self.assertEqual(l, list(range(10))) s = self.setClass([1, 2, None, 3]) enum = OC_TestSet.objectEnumeratorOfSet_(s) l = [] v = enum.nextObject() while v is not None: l.append(v) v = enum.nextObject() self.assertEqual(dict.fromkeys(l), dict.fromkeys([1,2,NSNull.null(),3]))