예제 #1
0
def test__chunk__split():
    c = PositionedChunk('foobarbar', 10, 20, None)
    a, b = c.split_at(3)
    assert a == PositionedChunk('foo', 10, 20, None)
    assert b == PositionedChunk('barbar', 13, 20, None)
예제 #2
0
def test__chunk__split_context_error():
    c = PositionedChunk('foobarbar', 10, 20, 'context')
    with pytest.raises(RuntimeError):
        c.split_at(4)