def test_prime_numbers_map(self): size = 12 number_list = new_map(lambda x: x, self.stream(size)) expected = [2, 3, 5, 7, 11] self.assertEquals(number_list, expected) self.assertEquals(len(set(number_list)), len(expected))
def test_random_numbers_map(self): size = 4 number_list = new_map(lambda x: x, self.stream(size)) self.assertEquals(len(number_list), size) self.assertEquals(len(set(number_list)), size)