def test_streamer_infinite(n_max, stream_size): reference = [] for i, data in enumerate(T.infinite_generator(size=stream_size)): if i >= n_max: break reference.append(data) streamer = pescador.core.Streamer(T.infinite_generator, size=stream_size) for i in range(3): query = list(streamer.iterate(max_iter=n_max)) for b1, b2 in zip(reference, query): T._eq_batch(b1, b2)
def test_streamer_in_streamer(n_max, stream_size): # TODO minimize copypasta from above test. reference = [] for i, data in enumerate(T.infinite_generator(size=stream_size)): if i >= n_max: break reference.append(data) streamer = pescador.core.Streamer(T.infinite_generator, size=stream_size) streamer2 = pescador.core.Streamer(streamer) for i in range(3): query = list(streamer2.iterate(max_iter=n_max)) for b1, b2 in zip(reference, query): T.__eq_batch(b1, b2)