summaryrefslogtreecommitdiff
path: root/tests/test_history.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2019-10-30 17:39:36 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2019-10-30 17:39:36 -0400
commit244af20b72c6581e935e998cb7e08c24feea55f5 (patch)
treefe037d7b293c9d03f5d5dfc139ac2578060a2ae7 /tests/test_history.py
parent23cfa3e2665c4fdbd22c781fe5b86bf034da71f8 (diff)
downloadcmd2-git-244af20b72c6581e935e998cb7e08c24feea55f5.tar.gz
do_history no longer calls do_edit since edit is a command that is commonly overridden
Diffstat (limited to 'tests/test_history.py')
-rwxr-xr-xtests/test_history.py17
1 files changed, 3 insertions, 14 deletions
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')