From 9efa8ee8d0e14d494eb954cd356d17832573deee Mon Sep 17 00:00:00 2001 From: Todd Leonhardt Date: Wed, 28 Jun 2017 17:57:23 -0400 Subject: Completely removed use of self.default_file_name Load and relative load now require a file path Edit will use a temporary file by default and delete it when done Save will use a temporary file by default and inform the user what it is Also changed the default value for autorun_on_edit to False so that it can safely be used as an actual file editor. --- tests/test_cmd2.py | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'tests/test_cmd2.py') diff --git a/tests/test_cmd2.py b/tests/test_cmd2.py index 92fdaa14..707699f3 100644 --- a/tests/test_cmd2.py +++ b/tests/test_cmd2.py @@ -545,10 +545,7 @@ def test_edit_number(base_app): run_cmd(base_app, 'edit 1') # We have an editor, so should expect a system call - m.assert_called_once_with('{} {}'.format(base_app.editor, base_app.default_file_name)) - - # Editing history item causes a file of default name to get created, remove it so we have a clean slate - os.remove(base_app.default_file_name) + m.assert_called_once() def test_edit_blank(base_app): @@ -565,10 +562,7 @@ def test_edit_blank(base_app): run_cmd(base_app, 'edit') # We have an editor, so should expect a system call - m.assert_called_once_with('{} {}'.format(base_app.editor, base_app.default_file_name)) - - # Editing history item causes a file of default name to get created, remove it so we have a clean slate - os.remove(base_app.default_file_name) + m.assert_called_once() def test_base_py_interactive(base_app): -- cgit v1.2.1