Exemple #1
0
def test_exact_page():
    stream = streams.wrap(iter([0, 1, 2, 3])).paginate(2)
    layers = 0
    for l in stream:
        utils.testWrapped(l)
        values = 0
        for v in l:
            assert v == values + (2 * layers)
            values += 1
        assert values == 2
        layers += 1
    assert layers == 2

    utils.testEmpty(stream)
Exemple #2
0
def test_empty():
    stream = streams.wrap(iter([]))

    utils.testEmpty(stream.filter(lambda x: x % 2 == 1))
Exemple #3
0
def test_empty():
    stream = streams.wrap(iter([])).paginate(1)

    utils.testEmpty(stream)
Exemple #4
0
def test_empty():
    stream = streams.wrap(iter([]))

    utils.testEmpty(stream.map(str))
Exemple #5
0
def test_empty():
    stream = streams.wrap(iter([]))

    utils.testEmpty(stream.flatten())
Exemple #6
0
def test_zero():
    sample_list = [1, 2, 3, 4, 5]
    stream = streams.wrap(iter(sample_list))

    utils.testEmpty(stream.limit(0))
Exemple #7
0
def test_empty():
    stream = streams.wrap(iter([]))

    utils.testEmpty(stream.limit(4))
Exemple #8
0
def test_empty():
    stream = streams.wrap(iter([]))
    finite = streams.wrap([1, 2, 3])

    utils.testEmpty(stream.zip(finite))
    utils.testEmpty(finite.zip(stream))