(mocker, capsys)
| 932 | |
| 933 | |
| 934 | def test_history_file_bad_json(mocker, capsys) -> None: |
| 935 | import lzma |
| 936 | |
| 937 | data = b"THIS IS NOT JSON" |
| 938 | compressed_data = lzma.compress(data) |
| 939 | |
| 940 | history_file = "/tmp/doesntmatter" |
| 941 | with open(history_file, "wb") as f: |
| 942 | f.write(compressed_data) |
| 943 | |
| 944 | cmd2.Cmd(persistent_history_file=history_file) |
| 945 | out, err = capsys.readouterr() |
| 946 | assert not out |
| 947 | assert "Error processing persistent history data" in err |
| 948 | |
| 949 | |
| 950 | def test_history_populates_pt(hist_file) -> None: |
nothing calls this directly
no test coverage detected
searching dependent graphs…