diff options
author | kotfu <kotfu@kotfu.net> | 2018-04-25 22:17:56 -0600 |
---|---|---|
committer | kotfu <kotfu@kotfu.net> | 2018-04-25 22:17:56 -0600 |
commit | 05ee395f0d487fc67979ce3d0824bdaadff5c811 (patch) | |
tree | ba2cf14ed249e2a0d3cb990e2944fc758c099a31 /tests | |
parent | a50c5683fd8aa499fb5dd4133198fe27c99c969c (diff) | |
download | cmd2-git-05ee395f0d487fc67979ce3d0824bdaadff5c811.tar.gz |
Remove POSIX_SHLEX and STRIP_QUOTES_FOR_NON_POSIX
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test_argparse.py | 14 | ||||
-rw-r--r-- | tests/test_cmd2.py | 7 | ||||
-rw-r--r-- | tests/test_transcript.py | 5 |
3 files changed, 1 insertions, 25 deletions
diff --git a/tests/test_argparse.py b/tests/test_argparse.py index 6a9a93a7..f7c6eaba 100644 --- a/tests/test_argparse.py +++ b/tests/test_argparse.py @@ -124,8 +124,6 @@ def test_argparse_basic_command(argparse_app): assert out == ['hello'] def test_argparse_quoted_arguments(argparse_app): - argparse_app.POSIX = False - argparse_app.STRIP_QUOTES_FOR_NON_POSIX = True out = run_cmd(argparse_app, 'say "hello there"') assert out == ['hello there'] @@ -138,21 +136,9 @@ def test_argparse_with_list_and_empty_doc(argparse_app): assert out == ['HELLO WORLD!'] def test_argparse_quoted_arguments_multiple(argparse_app): - argparse_app.POSIX = False - argparse_app.STRIP_QUOTES_FOR_NON_POSIX = True out = run_cmd(argparse_app, 'say "hello there" "rick & morty"') assert out == ['hello there rick & morty'] -def test_argparse_quoted_arguments_posix(argparse_app): - argparse_app.POSIX = True - out = run_cmd(argparse_app, 'tag strong this should be loud') - assert out == ['<strong>this should be loud</strong>'] - -def test_argparse_quoted_arguments_posix_multiple(argparse_app): - argparse_app.POSIX = True - out = run_cmd(argparse_app, 'tag strong this "should be" loud') - assert out == ['<strong>this should be loud</strong>'] - def test_argparse_help_docstring(argparse_app): out = run_cmd(argparse_app, 'help say') assert out[0].startswith('usage: say') diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 0a4dfbc6..2c9b03df 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -104,13 +104,8 @@ def test_base_show_readonly(base_app): Commands may be terminated with: {} Arguments at invocation allowed: {} Output redirection and pipes allowed: {} - Parsing of command arguments: - Shell lexer mode for command argument splitting: {} - Strip Quotes after splitting arguments: {} -""".format(base_app.terminators, base_app.allow_cli_args, base_app.allow_redirection, - "POSIX" if cmd2.cmd2.POSIX_SHLEX else "non-POSIX", - "True" if cmd2.cmd2.STRIP_QUOTES_FOR_NON_POSIX and not cmd2.cmd2.POSIX_SHLEX else "False")) +""".format(base_app.terminators, base_app.allow_cli_args, base_app.allow_redirection)) assert out == expected diff --git a/tests/test_transcript.py b/tests/test_transcript.py index 8ee5f3f6..bba56cab 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -15,7 +15,6 @@ from unittest import mock import pytest import cmd2 -from cmd2 import set_posix_shlex, set_strip_quotes from .conftest import run_cmd, StdOut, normalize class CmdLineApp(cmd2.Cmd): @@ -35,10 +34,6 @@ class CmdLineApp(cmd2.Cmd): super().__init__(*args, **kwargs) self.intro = 'This is an intro banner ...' - # Configure how arguments are parsed for commands using decorators - set_posix_shlex(False) - set_strip_quotes(True) - speak_parser = argparse.ArgumentParser() speak_parser.add_argument('-p', '--piglatin', action="store_true", help="atinLay") speak_parser.add_argument('-s', '--shout', action="store_true", help="N00B EMULATION MODE") |