summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/conftest.py6
-rwxr-xr-xtests/test_cmd2.py8
-rw-r--r--tests/transcripts/from_cmdloop.txt6
-rw-r--r--tests/transcripts/regex_set.txt3
4 files changed, 5 insertions, 18 deletions
diff --git a/tests/conftest.py b/tests/conftest.py
index fe74ffe2..b8abc4a5 100644
--- a/tests/conftest.py
+++ b/tests/conftest.py
@@ -89,28 +89,22 @@ SHORTCUTS_TXT = """Shortcuts for other commands:
# Output from the show command with default settings
SHOW_TXT = """allow_style: Terminal
-continuation_prompt: >
debug: False
echo: False
editor: vim
feedback_to_output: False
-locals_in_py: False
max_completion_items: 50
-prompt: (Cmd)
quiet: False
timing: False
"""
SHOW_LONG = """
allow_style: Terminal # Allow ANSI text style sequences in output (valid values: Terminal, Always, Never)
-continuation_prompt: > # On 2nd+ line of input
debug: False # Show full error stack on error
echo: False # Echo command issued into output
editor: vim # Program used by ``edit``
feedback_to_output: False # Include nonessentials in `|`, `>` results
-locals_in_py: False # Allow access to your application in py via self
max_completion_items: 50 # Maximum number of CompletionItems to display during tab completion
-prompt: (Cmd) # The prompt issued to solicit input
quiet: False # Don't print nonessential feedback
timing: False # Report execution times
"""
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index b5473609..21cd941e 100755
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -255,16 +255,12 @@ def test_base_py(base_app):
assert out[0].rstrip() == 'spaces in this command'
# Set locals_in_py to True and make sure we see self
- out, err = run_cmd(base_app, 'set locals_in_py True')
- assert 'now: True' in out
-
+ base_app.locals_in_py = True
out, err = run_cmd(base_app, 'py print(self)')
assert 'cmd2.cmd2.Cmd object' in out[0]
# Set locals_in_py to False and make sure we can't see self
- out, err = run_cmd(base_app, 'set locals_in_py False')
- assert 'now: False' in out
-
+ base_app.locals_in_py = False
out, err = run_cmd(base_app, 'py print(self)')
assert "NameError: name 'self' is not defined" in err
diff --git a/tests/transcripts/from_cmdloop.txt b/tests/transcripts/from_cmdloop.txt
index aede6659..95537665 100644
--- a/tests/transcripts/from_cmdloop.txt
+++ b/tests/transcripts/from_cmdloop.txt
@@ -39,6 +39,6 @@ OODNIGHT, GRACIEGAY
OODNIGHT, GRACIEGAY
OODNIGHT, GRACIEGAY
OODNIGHT, GRACIEGAY
-(Cmd) set prompt "---> "
-prompt - was: (Cmd)/ */
-now: --->/ */
+(Cmd) set debug True
+debug - was: False/ */
+now: True/ */
diff --git a/tests/transcripts/regex_set.txt b/tests/transcripts/regex_set.txt
index 17f43ede..5bf9add3 100644
--- a/tests/transcripts/regex_set.txt
+++ b/tests/transcripts/regex_set.txt
@@ -5,14 +5,11 @@
(Cmd) set
allow_style: /(Terminal|Always|Never)/
-continuation_prompt: >/ /
debug: False
echo: False
editor: /.*/
feedback_to_output: False
-locals_in_py: False
max_completion_items: 50
maxrepeats: 3
-prompt: (Cmd)/ /
quiet: False
timing: False