def test_infinite(self): outgen = seq.prepend(100, count(101)) outlist = list(islice(outgen, 0, 10)) self.assertEquals(outlist, range(100, 110))
def test_normal(self): outlist = seq.prepend(1, [2, 3, 4, 5]) self.assertEquals(list(outlist), [1, 2, 3, 4, 5])
def test_single(self): outlist = list(seq.prepend(self, [])) self.assertEquals([self], outlist)