MCPcopy Index your code
hub / github.com/idank/explainshell / test_valid_subcommand_mapping_ok

Method test_valid_subcommand_mapping_ok

tests/test_db_check.py:192–211  ·  view source on GitHub ↗

Subcommand mapping matching parent's declared subcommands should not warn.

(self, store, db_path)

Source from the content-addressed store, hash-verified

190 )
191
192 def test_valid_subcommand_mapping_ok(self, store, db_path):
193 """Subcommand mapping matching parent's declared subcommands should not warn."""
194 mp = ParsedManpage(
195 source="ubuntu/26.04/1/git.1.gz",
196 name="git",
197 synopsis="git - version control",
198 aliases=[("git", 10)],
199 subcommands=["commit"],
200 )
201 store.add_manpage(mp, _make_raw())
202 store.add_manpage(_make_manpage("git-commit", "1"), _make_raw())
203 store._conn.execute("PRAGMA foreign_keys = OFF")
204 store._conn.execute(
205 "INSERT INTO mappings(src, dst, score) VALUES (?, ?, ?)",
206 ("git commit", "ubuntu/26.04/1/git-commit.1.gz", 1),
207 )
208 store._conn.commit()
209 store._conn.execute("PRAGMA foreign_keys = ON")
210 issues = db_check(db_path)
211 assert not any("stale subcommand mapping" in msg for _, msg in issues)

Callers

nothing calls this directly

Calls 4

ParsedManpageClass · 0.90
add_manpageMethod · 0.80
_make_rawFunction · 0.70
_make_manpageFunction · 0.70

Tested by

no test coverage detected