diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-08 15:26:22 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-08 15:26:22 -0400 |
commit | 891fe3f34e2896b9c8d94a8c47c2c06f64f1ab93 (patch) | |
tree | d9fc2b7e075d0a55bab06c2f8a9e841d560313dc | |
parent | 770a5681fdcdad2cb1a6d0bca28d8fca0db1006c (diff) | |
parent | 87e0b94ab288ad80b8051ad00be6a5f4d48c472f (diff) | |
download | cmd2-git-891fe3f34e2896b9c8d94a8c47c2c06f64f1ab93.tar.gz |
Merge pull request #181 from python-cmd2/custom_intro
Added a unit test for custom intro when calling cmdloop()
-rw-r--r-- | CHANGES.md | 3 | ||||
-rw-r--r-- | tests/test_cmd2.py | 8 |
2 files changed, 6 insertions, 5 deletions
@@ -4,7 +4,7 @@ News 0.7.5 ----- -*Release date: 2017-TBD* +*Release date: 2017-07-08* * Bug Fixes * `case_insensitive` is no longer a runtime-settable parameter, but it was still listed as such @@ -17,6 +17,7 @@ News * Set the default value of `abbrev` to `False` (which controls whether or not abbreviated commands are allowed) * With good tab-completion of command names, using abbreviated commands isn't particularly useful * And it can create complications if you are't careful + * Improved implementation of `load` to use command queue instead of nested inner loop 0.7.4 ----- 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 |