def test_abwachsel(self): G = Gen() gen1, gen2 = G.g1(), G.g2() gen_abwachs = G.abwechselnd(gen1, gen2) x = list(islice(gen_abwachs, 0, 10)) y = [] for i in range(1, 6): y.append(i) y.append(i**2) self.assertEqual(x, y)
def test_gen1(self): G = Gen() gen = G.g1() x = list(islice(gen, 0, 10)) self.assertEqual(x, [i for i in range(1, 11)])