Skip to content

Commit 4661f86

Browse files
committed
Removed obsolete unit test
1 parent 33e8b86 commit 4661f86

File tree

1 file changed

+2
-27
lines changed

1 file changed

+2
-27
lines changed

tests/test_history.py

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ def test_exclude_from_history(base_app, monkeypatch):
801801
#
802802
@pytest.fixture(scope="session")
803803
def hist_file():
804-
fd, filename = tempfile.mkstemp(prefix='hist_file', suffix='.txt')
804+
fd, filename = tempfile.mkstemp(prefix='hist_file', suffix='.dat')
805805
os.close(fd)
806806
yield filename
807807
# teardown code
@@ -861,31 +861,6 @@ def test_history_file_permission_error(mocker, capsys):
861861
assert 'Cannot read' in err
862862

863863

864-
def test_history_file_conversion_no_truncate_on_init(hist_file, capsys):
865-
# make sure we don't truncate the plain text history file on init
866-
# it shouldn't get converted to pickle format until we save history
867-
868-
# first we need some plain text commands in the history file
869-
with open(hist_file, 'w') as hfobj:
870-
hfobj.write('help\n')
871-
hfobj.write('alias\n')
872-
hfobj.write('alias create s shortcuts\n')
873-
874-
# Create a new cmd2 app
875-
cmd2.Cmd(persistent_history_file=hist_file)
876-
877-
# history should be initialized, but the file on disk should
878-
# still be plain text
879-
with open(hist_file, 'r') as hfobj:
880-
histlist = hfobj.readlines()
881-
882-
assert len(histlist) == 3
883-
# history.get() is overridden to be one based, not zero based
884-
assert histlist[0] == 'help\n'
885-
assert histlist[1] == 'alias\n'
886-
assert histlist[2] == 'alias create s shortcuts\n'
887-
888-
889864
def test_history_populates_readline(hist_file):
890865
# - create a cmd2 with persistent history
891866
app = cmd2.Cmd(persistent_history_file=hist_file)
@@ -919,7 +894,7 @@ def test_history_populates_readline(hist_file):
919894

920895
#
921896
# test cmd2's ability to write out history on exit
922-
# we are testing the _persist_history_on_exit() method, and
897+
# we are testing the _persist_history() method, and
923898
# we assume that the atexit module will call this method
924899
# properly
925900
#

0 commit comments

Comments
 (0)