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

Method test_load_limit_respected

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

Source from the content-addressed store, hash-verified

577 assert count_sessions() == 2
578
579 def test_load_limit_respected(self, tmp_path, monkeypatch):
580 import openosint.session_history as sh
581
582 monkeypatch.setattr(sh, "HISTORY_DIR", tmp_path / "history")
583 from openosint.session_history import SessionRecord, load_sessions, save_session
584
585 for i in range(5):
586 save_session(
587 SessionRecord(
588 timestamp=f"2026-05-17T1{i}:00:00",
589 duration_seconds=i,
590 )
591 )
592 sessions = load_sessions(limit=3)
593 assert len(sessions) == 3
594
595 def test_clear_sessions_deletes_all(self, tmp_path, monkeypatch):
596 import openosint.session_history as sh

Callers

nothing calls this directly

Calls 3

save_sessionFunction · 0.90
SessionRecordClass · 0.90
load_sessionsFunction · 0.90

Tested by

no test coverage detected