summaryrefslogtreecommitdiff
path: root/tests/test_cmd2.py
diff options
context:
space:
mode:
authorTodd Leonhardt <tleonhardt@gmail.com>2017-06-28 17:57:23 -0400
committerTodd Leonhardt <tleonhardt@gmail.com>2017-06-28 17:57:23 -0400
commit9efa8ee8d0e14d494eb954cd356d17832573deee (patch)
tree057bc6f5fbb101ce3b4d0c5b68edebd8735eaae1 /tests/test_cmd2.py
parent38f509964141530a246effb87c0d3ed30e6918b1 (diff)
downloadcmd2-git-9efa8ee8d0e14d494eb954cd356d17832573deee.tar.gz
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.
Diffstat (limited to 'tests/test_cmd2.py')
-rw-r--r--tests/test_cmd2.py10
1 files changed, 2 insertions, 8 deletions
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):