Files
mctf/pamsave/sploits/test_password_substring.py
TakuyaYagam1 8f58bbef82 fix(exploits): submit only current flags
- Filter Pamsave files by the active flag lifetime window.
- Use Braindance attack-data record IDs instead of scanning history.
2026-11-29 15:03:15 +03:00

19 lines
553 B
Python

import unittest
from datetime import datetime, timezone
import password_substring
class FreshFileTests(unittest.TestCase):
def test_keeps_only_files_younger_than_flag_window(self) -> None:
now = datetime(2026, 11, 29, 12, 0, tzinfo=timezone.utc)
rows = [
{"id": "fresh", "created_at": "2026-11-29T11:58:30"},
{"id": "expired", "created_at": "2026-11-29T11:54:00"},
]
self.assertEqual(password_substring.fresh_file_ids(rows, now), ["fresh"])
if __name__ == "__main__":
unittest.main()