def test_returns_filtered_data_lazily(self): result = lineflow.filter(lambda x: x % 2 == 0, self.data, lazy=True) self.assertIsInstance(result, filter) expected = [x for x in self.data if x % 2 == 0] for x, y in zip(result, expected): self.assertEqual(x, y)
def test_returns_filtered_data_eagerly(self): result = lineflow.filter(lambda x: x % 2 == 0, self.data) expected = [x for x in self.data if x % 2 == 0] self.assertListEqual(result, expected)