Lines Matching refs:countOf
624 # Test iterators with operator.countOf (PySequence_Count).
626 from operator import countOf
627 self.assertEqual(countOf([1,2,2,3,2,5], 2), 3)
628 self.assertEqual(countOf((1,2,2,3,2,5), 2), 3)
629 self.assertEqual(countOf("122325", "2"), 3)
630 self.assertEqual(countOf("122325", "6"), 0)
632 self.assertRaises(TypeError, countOf, 42, 1)
633 self.assertRaises(TypeError, countOf, countOf, countOf)
637 self.assertEqual(countOf(d, k), 1)
638 self.assertEqual(countOf(d.itervalues(), 3), 3)
639 self.assertEqual(countOf(d.itervalues(), 2j), 1)
640 self.assertEqual(countOf(d.itervalues(), 1j), 0)
651 self.assertEqual(countOf(f, letter + "\n"), count)