diff options
author | Todd Leonhardt <todd.leonhardt@gmail.com> | 2019-10-30 22:12:12 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-30 22:12:12 -0400 |
commit | b1873c3e6a19276417e7b3a046b48db54a2d6304 (patch) | |
tree | e3b73cef6e9e3b164260e8c380d1f1d30b29dd83 /tests | |
parent | 406f017e2ee99fb76bada7bde4b52c3b0f1aa1d2 (diff) | |
parent | 1aa8d458dbbe797b29d0bd1fc4208a17adb6d222 (diff) | |
download | cmd2-git-b1873c3e6a19276417e7b3a046b48db54a2d6304.tar.gz |
Merge pull request #795 from python-cmd2/history_edit
do_history no longer calls do_edit
Diffstat (limited to 'tests')
-rwxr-xr-x | tests/test_history.py | 17 |
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') |