Show More
@@ -56,35 +56,33 b' def test_find_cmd_fail():' | |||
|
56 | 56 | pytest.raises(FindCmdError, find_cmd, "asdfasdf") |
|
57 | 57 | |
|
58 | 58 | |
|
59 | # TODO: move to pytest.mark.parametrize once nose gone | |
|
60 | 59 | @dec.skip_win32 |
|
61 | def test_arg_split(): | |
|
60 | @pytest.mark.parametrize('argstr, argv', [ | |
|
61 | ('hi', ['hi']), | |
|
62 | (u'hi', [u'hi']), | |
|
63 | ('hello there', ['hello', 'there']), | |
|
64 | # \u01ce == \N{LATIN SMALL LETTER A WITH CARON} | |
|
65 | # Do not use \N because the tests crash with syntax error in | |
|
66 | # some cases, for example windows python2.6. | |
|
67 | (u'h\u01cello', [u'h\u01cello']), | |
|
68 | ('something "with quotes"', ['something', '"with quotes"']), | |
|
69 | ]) | |
|
70 | def test_arg_split(argstr, argv): | |
|
62 | 71 | """Ensure that argument lines are correctly split like in a shell.""" |
|
63 | tests = [['hi', ['hi']], | |
|
64 | [u'hi', [u'hi']], | |
|
65 | ['hello there', ['hello', 'there']], | |
|
66 | # \u01ce == \N{LATIN SMALL LETTER A WITH CARON} | |
|
67 | # Do not use \N because the tests crash with syntax error in | |
|
68 | # some cases, for example windows python2.6. | |
|
69 | [u'h\u01cello', [u'h\u01cello']], | |
|
70 | ['something "with quotes"', ['something', '"with quotes"']], | |
|
71 | ] | |
|
72 | for argstr, argv in tests: | |
|
73 | assert arg_split(argstr) == argv | |
|
74 | ||
|
75 | ||
|
76 | # TODO: move to pytest.mark.parametrize once nose gone | |
|
72 | assert arg_split(argstr) == argv | |
|
73 | ||
|
74 | ||
|
77 | 75 | @dec.skip_if_not_win32 |
|
78 | def test_arg_split_win32(): | |
|
76 | @pytest.mark.parametrize('argstr,argv', [ | |
|
77 | ('hi', ['hi']), | |
|
78 | (u'hi', [u'hi']), | |
|
79 | ('hello there', ['hello', 'there']), | |
|
80 | (u'h\u01cello', [u'h\u01cello']), | |
|
81 | ('something "with quotes"', ['something', 'with quotes']), | |
|
82 | ]) | |
|
83 | def test_arg_split_win32(argstr, argv): | |
|
79 | 84 | """Ensure that argument lines are correctly split like in a shell.""" |
|
80 | tests = [['hi', ['hi']], | |
|
81 | [u'hi', [u'hi']], | |
|
82 | ['hello there', ['hello', 'there']], | |
|
83 | [u'h\u01cello', [u'h\u01cello']], | |
|
84 | ['something "with quotes"', ['something', 'with quotes']], | |
|
85 | ] | |
|
86 | for argstr, argv in tests: | |
|
87 | assert arg_split(argstr) == argv | |
|
85 | assert arg_split(argstr) == argv | |
|
88 | 86 | |
|
89 | 87 | |
|
90 | 88 | class SubProcessTestCase(tt.TempFileMixin): |
General Comments 0
You need to be logged in to leave comments.
Login now