Exemple #1
0
 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)
Exemple #2
0
 def test_gen2(self):
     G = Gen()
     gen = G.g2()
     x = list(islice(gen, 0, 10))
     self.assertEqual(x, [i**2 for i in range(1, 11)])