summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2021-02-19 21:40:15 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2021-02-19 21:40:15 -0500
commit486b8c726a7d657ef320e68598077c31fa664790 (patch)
tree46b53d0f530d6ae273c4379272684ee80026658a /tests/test_cmd2.py
parent3e180a810e9c4b9d251c135667d1d150b0bbd0dd (diff)
downloadcmd2-git-486b8c726a7d657ef320e68598077c31fa664790.tar.gz
Fixed black, isort, flake8, and doc8 issues
Diffstat (limited to 'tests/test_cmd2.py')
-rwxr-xr-xtests/test_cmd2.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index f94c0fb0..e719851e 100755
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -1590,6 +1590,7 @@ def test_read_input_rawinput_true(capsys, monkeypatch):
# Run custom history code
import readline
+
readline.add_history('old_history')
custom_history = ['cmd1', 'cmd2']
line = app.read_input(prompt_str, history=custom_history, completion_mode=cmd2.CompletionMode.NONE)
@@ -1605,23 +1606,21 @@ def test_read_input_rawinput_true(capsys, monkeypatch):
# custom choices
custom_choices = ['choice1', 'choice2']
- line = app.read_input(prompt_str, completion_mode=cmd2.CompletionMode.CUSTOM,
- choices=custom_choices)
+ line = app.read_input(prompt_str, completion_mode=cmd2.CompletionMode.CUSTOM, choices=custom_choices)
assert line == input_str
# custom choices_provider
- line = app.read_input(prompt_str, completion_mode=cmd2.CompletionMode.CUSTOM,
- choices_provider=cmd2.Cmd.get_all_commands)
+ line = app.read_input(
+ prompt_str, completion_mode=cmd2.CompletionMode.CUSTOM, choices_provider=cmd2.Cmd.get_all_commands
+ )
assert line == input_str
# custom completer
- line = app.read_input(prompt_str, completion_mode=cmd2.CompletionMode.CUSTOM,
- completer=cmd2.Cmd.path_complete)
+ line = app.read_input(prompt_str, completion_mode=cmd2.CompletionMode.CUSTOM, completer=cmd2.Cmd.path_complete)
assert line == input_str
# custom parser
- line = app.read_input(prompt_str, completion_mode=cmd2.CompletionMode.CUSTOM,
- parser=cmd2.Cmd2ArgumentParser())
+ line = app.read_input(prompt_str, completion_mode=cmd2.CompletionMode.CUSTOM, parser=cmd2.Cmd2ArgumentParser())
assert line == input_str
# isatty is False
@@ -1832,6 +1831,7 @@ def test_alias_create(base_app):
out, err = run_cmd(base_app, 'alias list fake')
assert out == normalize('alias create fake help')
+
def test_alias_create_with_quoted_tokens(base_app):
"""Demonstrate that quotes in alias value will be preserved"""
create_command = 'alias create fake help ">" "out file.txt" ";"'
@@ -1947,6 +1947,7 @@ def test_macro_create(base_app):
out, err = run_cmd(base_app, 'macro list fake')
assert out == normalize('macro create fake help')
+
def test_macro_create_with_quoted_tokens(base_app):
"""Demonstrate that quotes in macro value will be preserved"""
create_command = 'macro create fake help ">" "out file.txt" ";"'