Example #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'
Example #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'
Example #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'
Example #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'
Example #5
0
def test_parse_length_1_no_args():
    text = 'a'
    commands, _ = _cmdline_parse(State(text), text)
    assert len(commands) == 1, 'Expected to find one command'