Exemplo n.º 1
0
 def test_generator(self):
     iterable = MockGenerator([1, 2, 3])
     repeated = repeat(iterable, 3)
     assert iterable.evaluated == 0
     list(repeated)
     assert iterable.evaluated == 3 * 3
Exemplo n.º 2
0
 def test_result(self):
     iterable = range(14)
     repeated = repeat(iterable, 3)
     assert list(repeated) == list(iterable) * 3