コード例 #1
0
def test_slice(data):
    pars, expected = data
    a = Stream()
    b = a.slice(*pars)
    out = b.sink_to_list()
    for i in range(6):
        a.emit(i)
    assert out == expected
コード例 #2
0
def test_slice_err():
    a = Stream()
    with pytest.raises(ValueError):
        a.slice(end=-1)