Skip to content

Commit 891fe3f

Browse files
authored
Merge pull request #181 from python-cmd2/custom_intro
Added a unit test for custom intro when calling cmdloop()
2 parents 770a568 + 87e0b94 commit 891fe3f

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGES.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ News
44
0.7.5
55
-----
66

7-
*Release date: 2017-TBD*
7+
*Release date: 2017-07-08*
88

99
* Bug Fixes
1010
* `case_insensitive` is no longer a runtime-settable parameter, but it was still listed as such
@@ -17,6 +17,7 @@ News
1717
* Set the default value of `abbrev` to `False` (which controls whether or not abbreviated commands are allowed)
1818
* With good tab-completion of command names, using abbreviated commands isn't particularly useful
1919
* And it can create complications if you are't careful
20+
* Improved implementation of `load` to use command queue instead of nested inner loop
2021

2122
0.7.4
2223
-----

tests/test_cmd2.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -731,16 +731,16 @@ def test_base_cmdloop_with_queue():
731731
# Create a cmd2.Cmd() instance and make sure basic settings are like we want for test
732732
app = cmd2.Cmd()
733733
app.use_rawinput = True
734-
app.intro = 'Hello World, this is an intro ...'
734+
intro = 'Hello World, this is an intro ...'
735735
app.cmdqueue.append('quit\n')
736736
app.stdout = StdOut()
737737

738738
# Need to patch sys.argv so cmd2 doesn't think it was called with arguments equal to the py.test args
739739
testargs = ["prog"]
740-
expected = app.intro + '\n'
740+
expected = intro + '\n'
741741
with mock.patch.object(sys, 'argv', testargs):
742-
# Run the command loop
743-
app.cmdloop()
742+
# Run the command loop with custom intro
743+
app.cmdloop(intro=intro)
744744
out = app.stdout.buffer
745745
assert out == expected
746746

0 commit comments

Comments
 (0)