From 244af20b72c6581e935e998cb7e08c24feea55f5 Mon Sep 17 00:00:00 2001 From: Kevin Van Brunt Date: Wed, 30 Oct 2019 17:39:36 -0400 Subject: do_history no longer calls do_edit since edit is a command that is commonly overridden --- tests/test_history.py | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) (limited to 'tests') diff --git a/tests/test_history.py b/tests/test_history.py index 476cdd7e..4b900030 100755 --- a/tests/test_history.py +++ b/tests/test_history.py @@ -476,9 +476,9 @@ def test_history_edit(base_app, monkeypatch): # going to call it due to the mock base_app.editor = 'fooedit' - # Mock out the edit call so we don't actually open an editor - edit_mock = mock.MagicMock(name='do_edit') - monkeypatch.setattr("cmd2.Cmd.do_edit", edit_mock) + # Mock out the _run_editor call so we don't actually open an editor + edit_mock = mock.MagicMock(name='_run_editor') + monkeypatch.setattr("cmd2.Cmd._run_editor", edit_mock) # Mock out the run_script call since the mocked edit won't produce a file run_script_mock = mock.MagicMock(name='do_run_script') @@ -590,17 +590,6 @@ def test_base_help_history(base_app): assert out == normalize(HELP_HISTORY) def test_exclude_from_history(base_app, monkeypatch): - # Set a fake editor just to make sure we have one. We aren't - # really going to call it due to the mock - base_app.editor = 'fooedit' - - # Mock out the subprocess.Popen call so we don't actually open an editor - m = mock.MagicMock(name='Popen') - monkeypatch.setattr("subprocess.Popen", m) - - # Run edit command - run_cmd(base_app, 'edit') - # Run history command run_cmd(base_app, 'history') -- cgit v1.2.1