def test4(self): """test 04: distinct test""" pq = PyLINQ(data) self.assertEqual( pq.distinct(lambda x: x["class"]).items(), ["classA", "classB"])
def test4_a(self): """test 04: distinct test with default""" pq = PyLINQ([d['class'] for d in data]) self.assertEqual( pq.distinct().items(), ["classA", "classB"])