MCPcopy Create free account
hub / github.com/idank/explainshell / test_orphaned_mapping

Method test_orphaned_mapping

tests/test_db_check.py:62–73  ·  view source on GitHub ↗

Insert a mapping pointing to a non-existent manpage.

(self, store, db_path)

Source from the content-addressed store, hash-verified

60 assert any("malformed source path" in msg for msg in errors_list)
61
62 def test_orphaned_mapping(self, store, db_path):
63 """Insert a mapping pointing to a non-existent manpage."""
64 store._conn.execute("PRAGMA foreign_keys = OFF")
65 store._conn.execute(
66 "INSERT INTO mappings(src, dst, score) VALUES (?, ?, ?)",
67 ("ghost", "ubuntu/26.04/1/ghost.1.gz", 10),
68 )
69 store._conn.commit()
70 store._conn.execute("PRAGMA foreign_keys = ON")
71 issues = db_check(db_path)
72 errors_list = [msg for sev, msg in issues if sev == "error"]
73 assert any("orphaned mapping" in msg for msg in errors_list)
74
75 def test_unreachable_manpage(self, store, db_path):
76 """A manpage with no mappings should be flagged as a warning."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected