File tree Expand file tree Collapse file tree 1 file changed +15
-0
lines changed
Expand file tree Collapse file tree 1 file changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -1853,6 +1853,21 @@ def test_onecmd_raw_str_quit(outsim_app):
18531853 assert stop
18541854 assert out == ''
18551855
1856+ def test_onecmd_add_to_history (outsim_app ):
1857+ line = "help"
1858+ saved_hist_len = len (outsim_app .history )
1859+
1860+ # Allow command to be added to history
1861+ outsim_app .onecmd (line , add_to_history = True )
1862+ new_hist_len = len (outsim_app .history )
1863+ assert new_hist_len == saved_hist_len + 1
1864+
1865+ saved_hist_len = new_hist_len
1866+
1867+ # Prevent command from being added to history
1868+ outsim_app .onecmd (line , add_to_history = False )
1869+ new_hist_len = len (outsim_app .history )
1870+ assert new_hist_len == saved_hist_len
18561871
18571872def test_get_all_commands (base_app ):
18581873 # Verify that the base app has the expected commands
You can’t perform that action at this time.
0 commit comments