| 2334 | self.assertIn("No events recorded", result.output) |
| 2335 | |
| 2336 | def test_show_events_date_format(self): |
| 2337 | self.store.log_event( |
| 2338 | "extraction", |
| 2339 | { |
| 2340 | "version": 1, |
| 2341 | "command": "extract", |
| 2342 | "timestamp": "2026-04-14T10:30:00+00:00", |
| 2343 | "git": {"commit": None, "commit_short": None, "dirty": None}, |
| 2344 | "config": {"mode": "llm"}, |
| 2345 | "elapsed_seconds": 1.0, |
| 2346 | "summary": {"succeeded": 0, "skipped": 0, "failed": 0}, |
| 2347 | "db_before": {"manpages": 0, "mappings": 0}, |
| 2348 | "db_after": {"manpages": 0, "mappings": 0}, |
| 2349 | }, |
| 2350 | ) |
| 2351 | |
| 2352 | runner = CliRunner() |
| 2353 | result = runner.invoke(cli, ["--db", self.db_path, "show", "events"]) |
| 2354 | |
| 2355 | self.assertEqual(result.exit_code, 0) |
| 2356 | # Short date format: "YYYY-MM-DD HH:MM" |
| 2357 | self.assertRegex(result.output, r"\d{4}-\d{2}-\d{2} \d{2}:\d{2}") |
| 2358 | # Humanized delta in parentheses (e.g. "now", "2 days ago") |
| 2359 | self.assertRegex(result.output, r"\(.*ago\)|now\)") |
| 2360 | |
| 2361 | def test_show_events_extraction(self): |
| 2362 | self.store.log_event( |