@@ -801,7 +801,7 @@ def test_exclude_from_history(base_app, monkeypatch):
801
801
#
802
802
@pytest .fixture (scope = "session" )
803
803
def hist_file ():
804
- fd , filename = tempfile .mkstemp (prefix = 'hist_file' , suffix = '.txt ' )
804
+ fd , filename = tempfile .mkstemp (prefix = 'hist_file' , suffix = '.dat ' )
805
805
os .close (fd )
806
806
yield filename
807
807
# teardown code
@@ -861,31 +861,6 @@ def test_history_file_permission_error(mocker, capsys):
861
861
assert 'Cannot read' in err
862
862
863
863
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
-
889
864
def test_history_populates_readline (hist_file ):
890
865
# - create a cmd2 with persistent history
891
866
app = cmd2 .Cmd (persistent_history_file = hist_file )
@@ -919,7 +894,7 @@ def test_history_populates_readline(hist_file):
919
894
920
895
#
921
896
# 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
923
898
# we assume that the atexit module will call this method
924
899
# properly
925
900
#
0 commit comments