1111
1212import cmd2
1313from cmd2 import constants , utils
14- from cmd2 .constants import MULTILINE_TERMINATOR
1514from cmd2 .parsing import StatementParser , shlex_split
1615
1716@pytest .fixture
@@ -46,7 +45,7 @@ def test_parse_empty_string(parser):
4645 assert statement .multiline_command == ''
4746 assert statement .terminator == ''
4847 assert statement .suffix == ''
49- assert statement .pipe_to == []
48+ assert statement .pipe_to == ''
5049 assert statement .output == ''
5150 assert statement .output_to == ''
5251 assert statement .command_and_args == line
@@ -63,7 +62,7 @@ def test_parse_empty_string_default(default_parser):
6362 assert statement .multiline_command == ''
6463 assert statement .terminator == ''
6564 assert statement .suffix == ''
66- assert statement .pipe_to == []
65+ assert statement .pipe_to == ''
6766 assert statement .output == ''
6867 assert statement .output_to == ''
6968 assert statement .command_and_args == line
@@ -130,7 +129,7 @@ def test_parse_single_word(parser, line):
130129 assert statement .multiline_command == ''
131130 assert statement .terminator == ''
132131 assert statement .suffix == ''
133- assert statement .pipe_to == []
132+ assert statement .pipe_to == ''
134133 assert statement .output == ''
135134 assert statement .output_to == ''
136135 assert statement .command_and_args == line
@@ -224,8 +223,8 @@ def test_parse_simple_pipe(parser, line):
224223 assert statement .args == statement
225224 assert statement .argv == ['simple' ]
226225 assert not statement .arg_list
227- assert statement .pipe_to == [ 'piped' ]
228- assert statement .expanded_command_line == statement .command + ' | ' + ' ' . join ( statement .pipe_to )
226+ assert statement .pipe_to == 'piped'
227+ assert statement .expanded_command_line == statement .command + ' | ' + statement .pipe_to
229228
230229def test_parse_double_pipe_is_not_a_pipe (parser ):
231230 line = 'double-pipe || is not a pipe'
@@ -247,7 +246,7 @@ def test_parse_complex_pipe(parser):
247246 assert statement .arg_list == statement .argv [1 :]
248247 assert statement .terminator == '&'
249248 assert statement .suffix == 'sufx'
250- assert statement .pipe_to == [ 'piped' ]
249+ assert statement .pipe_to == 'piped'
251250
252251@pytest .mark .parametrize ('line,output' , [
253252 ('help > out.txt' , '>' ),
@@ -307,7 +306,7 @@ def test_parse_pipe_and_redirect(parser):
307306 assert statement .arg_list == statement .argv [1 :]
308307 assert statement .terminator == ';'
309308 assert statement .suffix == 'sufx'
310- assert statement .pipe_to == [ 'pipethrume' , ' plz' , '>' , ' afile.txt']
309+ assert statement .pipe_to == 'pipethrume plz > afile.txt'
311310 assert statement .output == ''
312311 assert statement .output_to == ''
313312
@@ -516,7 +515,7 @@ def test_parse_alias_pipe(parser, line):
516515 assert statement .command == 'help'
517516 assert statement == ''
518517 assert statement .args == statement
519- assert statement .pipe_to == [ 'less' ]
518+ assert statement .pipe_to == 'less'
520519
521520@pytest .mark .parametrize ('line' , [
522521 'helpalias;' ,
@@ -545,7 +544,7 @@ def test_parse_command_only_command_and_args(parser):
545544 assert statement .raw == line
546545 assert statement .terminator == ''
547546 assert statement .suffix == ''
548- assert statement .pipe_to == []
547+ assert statement .pipe_to == ''
549548 assert statement .output == ''
550549 assert statement .output_to == ''
551550
@@ -561,7 +560,7 @@ def test_parse_command_only_strips_line(parser):
561560 assert statement .raw == line
562561 assert statement .terminator == ''
563562 assert statement .suffix == ''
564- assert statement .pipe_to == []
563+ assert statement .pipe_to == ''
565564 assert statement .output == ''
566565 assert statement .output_to == ''
567566
@@ -577,7 +576,7 @@ def test_parse_command_only_expands_alias(parser):
577576 assert statement .raw == line
578577 assert statement .terminator == ''
579578 assert statement .suffix == ''
580- assert statement .pipe_to == []
579+ assert statement .pipe_to == ''
581580 assert statement .output == ''
582581 assert statement .output_to == ''
583582
@@ -594,7 +593,7 @@ def test_parse_command_only_expands_shortcuts(parser):
594593 assert statement .multiline_command == ''
595594 assert statement .terminator == ''
596595 assert statement .suffix == ''
597- assert statement .pipe_to == []
596+ assert statement .pipe_to == ''
598597 assert statement .output == ''
599598 assert statement .output_to == ''
600599
@@ -611,7 +610,7 @@ def test_parse_command_only_quoted_args(parser):
611610 assert statement .multiline_command == ''
612611 assert statement .terminator == ''
613612 assert statement .suffix == ''
614- assert statement .pipe_to == []
613+ assert statement .pipe_to == ''
615614 assert statement .output == ''
616615 assert statement .output_to == ''
617616
@@ -635,7 +634,7 @@ def test_parse_command_only_specialchars(parser, line, args):
635634 assert statement .multiline_command == ''
636635 assert statement .terminator == ''
637636 assert statement .suffix == ''
638- assert statement .pipe_to == []
637+ assert statement .pipe_to == ''
639638 assert statement .output == ''
640639 assert statement .output_to == ''
641640
@@ -664,7 +663,7 @@ def test_parse_command_only_empty(parser, line):
664663 assert statement .multiline_command == ''
665664 assert statement .terminator == ''
666665 assert statement .suffix == ''
667- assert statement .pipe_to == []
666+ assert statement .pipe_to == ''
668667 assert statement .output == ''
669668 assert statement .output_to == ''
670669
@@ -692,7 +691,7 @@ def test_statement_initialization():
692691 assert statement .multiline_command == ''
693692 assert statement .terminator == ''
694693 assert statement .suffix == ''
695- assert isinstance (statement .pipe_to , list )
694+ assert isinstance (statement .pipe_to , str )
696695 assert not statement .pipe_to
697696 assert statement .output == ''
698697 assert statement .output_to == ''
0 commit comments