diff options
| author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-03 17:22:16 -0400 |
|---|---|---|
| committer | Todd Leonhardt <todd.leonhardt@gmail.com> | 2017-07-03 17:22:16 -0400 |
| commit | 29eeb8996053f35572f4d7b63e7c8cb0f62b6442 (patch) | |
| tree | d5ea2e52b6e3a09f54731aa4858370cdcbcb6e75 /tests | |
| parent | b06c95b721b7a1096ce78ec3a96726cdbe7026ad (diff) | |
| download | cmd2-git-29eeb8996053f35572f4d7b63e7c8cb0f62b6442.tar.gz | |
Removed pause command
It was pretty useless, it just printed a message and sat there and waited for the user to hit enter.
It didn't feel like it belonged in a top-level framework. If a particular application wants this functionality, it is a 2 line change to add it back.
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/conftest.py | 4 | ||||
| -rw-r--r-- | tests/test_cmd2.py | 24 | ||||
| -rw-r--r-- | tests/test_transcript.py | 5 | ||||
| -rw-r--r-- | tests/transcript.txt | 5 |
4 files changed, 14 insertions, 24 deletions
diff --git a/tests/conftest.py b/tests/conftest.py index 6941d9fc..69001e42 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -15,8 +15,8 @@ import cmd2 # Help text for base cmd2.Cmd application BASE_HELP = """Documented commands (type help <topic>): ======================================== -_relative_load edit history pause pyscript run set shortcuts -cmdenvironment help load py quit save shell show +_relative_load edit history py quit save shell show +cmdenvironment help load pyscript run set shortcuts """ # Help text for the history command diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 02a26af9..98e99cbf 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -182,14 +182,6 @@ def test_base_error(base_app): assert out == ["*** Unknown syntax: meow"] -def test_base_pause(base_app): - # Mock out the input call so we don't actually wait for a user's response on stdin - m = mock.MagicMock(name='input', return_value='\n') - sm.input = m - - run_cmd(base_app, 'pause') - m.assert_called_once() - def test_base_history(base_app): run_cmd(base_app, 'help') run_cmd(base_app, 'shortcuts') @@ -556,9 +548,9 @@ def test_pipe_to_shell(base_app): # Windows # Get help menu and pipe it's output to the sort shell command out = run_cmd(base_app, 'help | sort') - expected = ['', '', '_relative_load edit history pause pyscript run set shortcuts', + expected = ['', '', '_relative_load edit history py quit save shell show', '========================================', - 'cmdenvironment help load py quit save shell show', + 'cmdenvironment help load pyscript run set shortcuts', 'Documented commands (type help <topic>):'] assert out == expected else: @@ -870,8 +862,8 @@ class HelpApp(cmd2.Cmd): def help_squat(self): self.stdout.write('This command does diddly squat...\n') - def do_pause(self, arg): - """This overrides the pause command and does nothing.""" + def do_edit(self, arg): + """This overrides the edit command and does nothing.""" pass # This command will be in the "undocumented" section of the help menu @@ -894,8 +886,8 @@ def test_custom_help_menu(help_app): expected = normalize(""" Documented commands (type help <topic>): ======================================== -_relative_load edit history pause pyscript run set shortcuts squat -cmdenvironment help load py quit save shell show +_relative_load edit history py quit save shell show +cmdenvironment help load pyscript run set shortcuts squat Undocumented commands: ====================== @@ -909,8 +901,8 @@ def test_help_undocumented(help_app): assert out == expected def test_help_overridden_method(help_app): - out = run_cmd(help_app, 'help pause') - expected = normalize('This overrides the pause command and does nothing.') + out = run_cmd(help_app, 'help edit') + expected = normalize('This overrides the edit command and does nothing.') assert out == expected diff --git a/tests/test_transcript.py b/tests/test_transcript.py index 87640b5e..4ffcd162 100644 --- a/tests/test_transcript.py +++ b/tests/test_transcript.py @@ -106,9 +106,8 @@ def test_base_with_transcript(_cmdline_app): Documented commands (type help <topic>): ======================================== -_relative_load help orate pyscript save shell speak -cmdenvironment history pause quit say shortcuts -edit load py run set show +_relative_load edit history orate pyscript run say shell show +cmdenvironment help load py quit save set shortcuts speak (Cmd) help say Repeats what you tell me to. diff --git a/tests/transcript.txt b/tests/transcript.txt index 582f08cb..e95b9b39 100644 --- a/tests/transcript.txt +++ b/tests/transcript.txt @@ -2,9 +2,8 @@ Documented commands (type help <topic>): ======================================== -_relative_load help orate pyscript save shell speak -cmdenvironment history pause quit say shortcuts -edit load py run set show +_relative_load edit history orate pyscript run say shell show +cmdenvironment help load py quit save set shortcuts speak (Cmd) help say Repeats what you tell me to. |
