summaryrefslogtreecommitdiff
path: root/tests/test_history.py
diff options
context:
space:
mode:
authorKevin Van Brunt <kmvanbrunt@gmail.com>2021-06-10 14:09:56 -0400
committerKevin Van Brunt <kmvanbrunt@gmail.com>2021-06-14 11:28:25 -0400
commit4661f8621fe4353ed13d3bd7a597243f43b353b4 (patch)
tree6998f7d9c73cd2ae72612a0e5163d7ab5113306a /tests/test_history.py
parent33e8b86310d1f160ef77365a2d09665af9ce27d7 (diff)
downloadcmd2-git-4661f8621fe4353ed13d3bd7a597243f43b353b4.tar.gz
Removed obsolete unit test
Diffstat (limited to 'tests/test_history.py')
-rwxr-xr-xtests/test_history.py29
1 files changed, 2 insertions, 27 deletions
diff --git a/tests/test_history.py b/tests/test_history.py
index a4ec755e..49959a2e 100755
--- a/tests/test_history.py
+++ b/tests/test_history.py
@@ -801,7 +801,7 @@ def test_exclude_from_history(base_app, monkeypatch):
#
@pytest.fixture(scope="session")
def hist_file():
- fd, filename = tempfile.mkstemp(prefix='hist_file', suffix='.txt')
+ fd, filename = tempfile.mkstemp(prefix='hist_file', suffix='.dat')
os.close(fd)
yield filename
# teardown code
@@ -861,31 +861,6 @@ def test_history_file_permission_error(mocker, capsys):
assert 'Cannot read' in err
-def test_history_file_conversion_no_truncate_on_init(hist_file, capsys):
- # make sure we don't truncate the plain text history file on init
- # it shouldn't get converted to pickle format until we save history
-
- # first we need some plain text commands in the history file
- with open(hist_file, 'w') as hfobj:
- hfobj.write('help\n')
- hfobj.write('alias\n')
- hfobj.write('alias create s shortcuts\n')
-
- # Create a new cmd2 app
- cmd2.Cmd(persistent_history_file=hist_file)
-
- # history should be initialized, but the file on disk should
- # still be plain text
- with open(hist_file, 'r') as hfobj:
- histlist = hfobj.readlines()
-
- assert len(histlist) == 3
- # history.get() is overridden to be one based, not zero based
- assert histlist[0] == 'help\n'
- assert histlist[1] == 'alias\n'
- assert histlist[2] == 'alias create s shortcuts\n'
-
-
def test_history_populates_readline(hist_file):
# - create a cmd2 with persistent history
app = cmd2.Cmd(persistent_history_file=hist_file)
@@ -919,7 +894,7 @@ def test_history_populates_readline(hist_file):
#
# test cmd2's ability to write out history on exit
-# we are testing the _persist_history_on_exit() method, and
+# we are testing the _persist_history() method, and
# we assume that the atexit module will call this method
# properly
#