def test_prime_numbers_prefix_reduce(self): size = 12 stream = self.stream(size) number_list = prefix_reduce(sum, stream) expected = [5, 10, 17, 28] self.assertEquals(number_list, expected)
def test_random_numbers_prefix_reduce(self): size = 5 stream = self.stream(size) number_list = prefix_reduce(sum, stream) self.assertEquals(len(number_list), size - 1)