Insert an orphaned mapping so db-check has something to report.
(self)
| 2466 | self.assertIn("No issues found", result.output) |
| 2467 | |
| 2468 | def test_reports_issues(self): |
| 2469 | """Insert an orphaned mapping so db-check has something to report.""" |
| 2470 | self.store._conn.execute("PRAGMA foreign_keys = OFF") |
| 2471 | self.store._conn.execute( |
| 2472 | "INSERT INTO mappings(src, dst, score) VALUES (?, ?, ?)", |
| 2473 | ("ghost", "ubuntu/26.04/1/ghost.1.gz", 10), |
| 2474 | ) |
| 2475 | self.store._conn.commit() |
| 2476 | self.store._conn.execute("PRAGMA foreign_keys = ON") |
| 2477 | |
| 2478 | runner = CliRunner() |
| 2479 | result = runner.invoke(cli, ["--db", self.db_path, "db-check"]) |
| 2480 | |
| 2481 | self.assertNotEqual(result.exit_code, 0) |
| 2482 | self.assertIn("orphaned mapping", result.output) |
| 2483 | |
| 2484 | def test_nonexistent_db(self): |
| 2485 | runner = CliRunner() |
nothing calls this directly
no outgoing calls
no test coverage detected