def each_key(self, key): """ Enter into key, emit each item in list """ current_pipe = pipes.EachKeyPipe(key) self.pipeline.add_pipe(current_pipe) return self
def test_pipe_each_key_mixed_none(self): each_key_pipe = pipes.EachKeyPipe('testKey') data = [{"key2": [5, 7]}, {"testKey": [4, 8, 5, 2]}, {"testKey": None}] each_key_pipe.set_starts(recommend_utils.ListIterator(data)) list_out = self._iterate_pipe(each_key_pipe) self.assertEqual(list_out, [4, 8, 5, 2])