summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2020-01-27 22:36:49 -0500
committerTodd Leonhardt <todd.leonhardt@gmail.com>2020-01-27 22:36:49 -0500
commit0f8f90cc2ade4135193f5399e5e6a12271668867 (patch)
treea3f8fd2c274fbac5293e218a70f55101f7b64633 /tests/test_cmd2.py
parent95f8d883496044bcb95ce803752a8851de6ad0e5 (diff)
downloadcmd2-git-0f8f90cc2ade4135193f5399e5e6a12271668867.tar.gz
Made three public attributes of cmd2.Cmd no longer settable at runtime by end users
The 3 attributes are: - continuation_prompt - locals_in_py - prompt
Diffstat (limited to 'tests/test_cmd2.py')
-rwxr-xr-xtests/test_cmd2.py8
1 files changed, 2 insertions, 6 deletions
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