MCPcopy Create free account
hub / github.com/OpenOSINT/OpenOSINT / test_clear_sessions_deletes_all

Method test_clear_sessions_deletes_all

tests/test_tools.py:595–610  ·  view source on GitHub ↗
(self, tmp_path, monkeypatch)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 4

save_sessionFunction · 0.90
SessionRecordClass · 0.90
clear_sessionsFunction · 0.90
count_sessionsFunction · 0.90

Tested by

no test coverage detected