Beispiel #1
0
def test_parse_length_1_with_args():
    text = 'a -b c'
    commands, _ = _cmdline_parse(ps(text), text)
    assert len(commands) == 1, 'Expected to find one command'
Beispiel #2
0
def test_parse_length_3_no_args():
    text = 'a | b | c'
    commands, _ = _cmdline_parse(ps(text), text)
    assert len(commands) == 3, 'Expected to find three commands'
Beispiel #3
0
def test_parse_length_3_with_args():
    text = 'a -b c | d -e | f'
    commands, _ = _cmdline_parse(ps(text), text)
    assert len(commands) == 3, 'Expected to find three commands'
Beispiel #4
0
def test_parse_result_is_list_of_lists():
    text = 'a -b c | d -e | f'
    commands, _ = _cmdline_parse(ps(text), text)
    assert all([type(c) == list for c in commands]), 'Expected all parsed elements to be lists'
def test_parse_length_1_no_args():
    text = 'a'
    commands, _ = _cmdline_parse(State(text), text)
    assert len(commands) == 1, 'Expected to find one command'