summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2017-07-08 15:19:00 -0400
committerTodd Leonhardt <todd.leonhardt@gmail.com>2017-07-08 15:19:00 -0400
commit87e0b94ab288ad80b8051ad00be6a5f4d48c472f (patch)
treed9fc2b7e075d0a55bab06c2f8a9e841d560313dc /tests/test_cmd2.py
parent770a5681fdcdad2cb1a6d0bca28d8fca0db1006c (diff)
downloadcmd2-git-87e0b94ab288ad80b8051ad00be6a5f4d48c472f.tar.gz
Added a unit test for custom intro when calling cmdloop()
Also updated CHANGES.md
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py
index ee8f6c87..a32fba76 100644
--- a/tests/test_cmd2.py
+++ b/tests/test_cmd2.py
@@ -731,16 +731,16 @@ def test_base_cmdloop_with_queue():
# Create a cmd2.Cmd() instance and make sure basic settings are like we want for test
app = cmd2.Cmd()
app.use_rawinput = True
- app.intro = 'Hello World, this is an intro ...'
+ intro = 'Hello World, this is an intro ...'
app.cmdqueue.append('quit\n')
app.stdout = StdOut()
# Need to patch sys.argv so cmd2 doesn't think it was called with arguments equal to the py.test args
testargs = ["prog"]
- expected = app.intro + '\n'
+ expected = intro + '\n'
with mock.patch.object(sys, 'argv', testargs):
- # Run the command loop
- app.cmdloop()
+ # Run the command loop with custom intro
+ app.cmdloop(intro=intro)
out = app.stdout.buffer
assert out == expected