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

Method test_malformed_source

tests/test_db_check.py:49–60  ·  view source on GitHub ↗

Directly insert a row with a bare source to test the checker.

(self, store, db_path)

Source from the content-addressed store, hash-verified

47 assert db_check(db_path) == []
48
49 def test_malformed_source(self, store, db_path):
50 """Directly insert a row with a bare source to test the checker."""
51 store._conn.execute("PRAGMA foreign_keys = OFF")
52 store._conn.execute(
53 "INSERT INTO parsed_manpages(source, name, options, aliases) VALUES (?, ?, '[]', '[]')",
54 ("tar.1.gz", "tar"),
55 )
56 store._conn.commit()
57 store._conn.execute("PRAGMA foreign_keys = ON")
58 issues = db_check(db_path)
59 errors_list = [msg for sev, msg in issues if sev == "error"]
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."""

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected