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

Method test_subcommands

tests/test_matcher.py:355–371  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

353 self.assertMatchSingle(cmd, s.find_man_page("baz")[0], matchedresult)
354
355 def test_subcommands(self):
356 cmd = "bar baz --b foo"
357 matchedresult = [
358 MR(0, 3, "bar synopsis", "bar"),
359 MR(4, 7, None, "baz"),
360 MR(8, 15, "-b <arg> desc", "--b foo"),
361 ]
362
363 self.assertMatchSingle(cmd, s.find_man_page("bar")[0], matchedresult)
364
365 cmd = "bar foo --b foo"
366 matchedresult = [
367 MR(0, 7, "bar foo synopsis", "bar foo"),
368 MR(8, 15, "-b <arg> desc", "--b foo"),
369 ]
370
371 self.assertMatchSingle(cmd, s.find_man_page("bar foo")[0], matchedresult)
372
373 def test_multiple_matches(self):
374 cmd = "dup -ab"

Callers

nothing calls this directly

Calls 2

assertMatchSingleMethod · 0.95
find_man_pageMethod · 0.45

Tested by

no test coverage detected