コード例 #1
0
def test_parse_single_word(parser, line):
    statement = parser.parse(line)
    assert statement.command == line
    assert statement == ''
    assert statement.argv == [utils.strip_quotes(line)]
    assert not statement.arg_list
    assert statement.args == statement
    assert statement.raw == line
    assert statement.multiline_command == ''
    assert statement.terminator == ''
    assert statement.suffix == ''
    assert statement.pipe_to == ''
    assert statement.output == ''
    assert statement.output_to == ''
    assert statement.command_and_args == line
コード例 #2
0
def test_strip_quotes_with_quotes():
    base_str = '"' + HELLO_WORLD + '"'
    stripped = cu.strip_quotes(base_str)
    assert stripped == HELLO_WORLD
コード例 #3
0
def test_strip_quotes_no_quotes():
    base_str = HELLO_WORLD
    stripped = cu.strip_quotes(base_str)
    assert base_str == stripped
コード例 #4
0
ファイル: test_parsing.py プロジェクト: rowhit/cmd2
def test_parse_single_word(parser, line):
    statement = parser.parse(line)
    assert statement.command == line
    assert statement.args is None
    assert statement == ''
    assert statement.argv == [utils.strip_quotes(line)]