示例#1
0
def test_redirect_cannot_open():
    text = '> b'
    with pytest.raises(TF):
        _cmdline_get_redirect(ps(text), text)
示例#2
0
def test_redirect_dangling():
    text = 'a >'
    with pytest.raises(TF):
        _cmdline_get_redirect(ps(text), text)
示例#3
0
def test_redirect_to_command():
    text = 'a > b c'
    with pytest.raises(TF):
        _cmdline_get_redirect(ps(text), text)
示例#4
0
def test_redirect_double():
    text = 'a > d > e'
    with pytest.raises(TF):
        _cmdline_get_redirect(ps(text), text)
示例#5
0
def test_redirect_before_pipe():
    text = 'a > d | e'
    with pytest.raises(TF):
        _cmdline_get_redirect(ps(text), text)
示例#6
0
def test_redirect_not_found():
    text = 'a'
    _, redirect = _cmdline_get_redirect(ps(text), text)
    assert redirect is None
示例#7
0
def test_redirect_found_without_spaces():
    text = 'a>d'
    _, redirect = _cmdline_get_redirect(ps(text), text)
    assert redirect == 'd'
示例#8
0
def test_redirect_cannot_open():
    text = '> b'
    with pytest.raises(Exception):
        _cmdline_get_redirect(State(text), text)
示例#9
0
def test_redirect_to_command():
    text = 'a > b c'
    with pytest.raises(Exception):
        _cmdline_get_redirect(State(text), text)
示例#10
0
def test_redirect_dangling():
    text = 'a >'
    with pytest.raises(Exception):
        _cmdline_get_redirect(State(text), text)
示例#11
0
def test_redirect_before_pipe():
    text = 'a > d | e'
    with pytest.raises(Exception):
        _cmdline_get_redirect(State(text), text)
示例#12
0
def test_redirect_double():
    text = 'a > d > e'
    with pytest.raises(Exception):
        _cmdline_get_redirect(State(text), text)