def test_doubler():
    y = generator.doubler()
    assert next(y) == 1
    assert next(y) == 2
    assert next(y) == 4
    assert next(y) == 8
    assert next(y) == 16
    assert next(y) == 32
    for i in range(10):
        v = next(y)
    assert v == 2**15
Example #2
0
def test_doubler():

    g = gen.doubler()

    assert next(g) == 1
    assert next(g) == 2
    assert next(g) == 4
    assert next(g) == 8
    assert next(g) == 16
    assert next(g) == 32

    for i in range(10):
        j = next(g)

    assert j == 2**15
Example #3
0
def test_doubler():
    
    g = gen.doubler()

    assert g.next() == 1
    assert g.next() == 2
    assert g.next() == 4
    assert g.next() == 8
    assert g.next() == 16
    assert g.next() == 32

    for i in range(10):
        j = g.next()

    assert j == 2**15
def test_doubler():
    g = gs.doubler()
    for val in [1, 2, 4, 8, 16, 32, 64]:
        assert next(g) == val
Example #5
0
def test_doubler():
    g = gs.doubler()
    for val in [1, 2, 4, 8, 16, 32, 64]:
        assert next(g) == val