Test loading history strings yields all items newest to oldest.
(self)
| 529 | |
| 530 | class TestCmd2History: |
| 531 | def test_load_history_strings(self): |
| 532 | """Test loading history strings yields all items newest to oldest.""" |
| 533 | |
| 534 | history_strings = ["cmd1", "cmd2", "cmd2", "cmd3", "cmd2"] |
| 535 | history = pt_utils.Cmd2History(history_strings) |
| 536 | assert history._loaded |
| 537 | |
| 538 | # Consecutive duplicates are removed |
| 539 | expected = ["cmd2", "cmd3", "cmd2", "cmd1"] |
| 540 | assert list(history.load_history_strings()) == expected |
| 541 | |
| 542 | def test_load_history_strings_empty(self): |
| 543 | """Test loading history strings with empty history.""" |
nothing calls this directly
no test coverage detected