(self, tmp_path, monkeypatch)
| 593 | assert len(sessions) == 3 |
| 594 | |
| 595 | def test_clear_sessions_deletes_all(self, tmp_path, monkeypatch): |
| 596 | import openosint.session_history as sh |
| 597 | |
| 598 | monkeypatch.setattr(sh, "HISTORY_DIR", tmp_path / "history") |
| 599 | from openosint.session_history import ( |
| 600 | SessionRecord, |
| 601 | clear_sessions, |
| 602 | count_sessions, |
| 603 | save_session, |
| 604 | ) |
| 605 | |
| 606 | save_session(SessionRecord(timestamp="2026-05-17T12:00:00", duration_seconds=1)) |
| 607 | save_session(SessionRecord(timestamp="2026-05-17T13:00:00", duration_seconds=2)) |
| 608 | deleted = clear_sessions() |
| 609 | assert deleted == 2 |
| 610 | assert count_sessions() == 0 |
| 611 | |
| 612 | def test_clear_sessions_when_no_history(self, tmp_path, monkeypatch): |
| 613 | import openosint.session_history as sh |
nothing calls this directly
no test coverage detected