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

Method test_section_among_multiple

tests/test_store.py:115–125  ·  view source on GitHub ↗

When multiple sections exist, the requested one should come first.

(self, store)

Source from the content-addressed store, hash-verified

113 store.find_man_page("printf.9")
114
115 def test_section_among_multiple(self, store):
116 """When multiple sections exist, the requested one should come first."""
117 mp1 = _make_manpage("open", "1", aliases=[("open", 10)])
118 mp2 = _make_manpage("open", "2", aliases=[("open", 10)])
119 mp3 = _make_manpage("open", "3", aliases=[("open", 10)])
120 store.add_manpage(mp1, _make_raw())
121 store.add_manpage(mp2, _make_raw())
122 store.add_manpage(mp3, _make_raw())
123
124 results = store.find_man_page("open.2")
125 assert results[0].section == "2"
126
127
128class TestFindManpageExactSource:

Callers

nothing calls this directly

Calls 4

add_manpageMethod · 0.80
_make_manpageFunction · 0.70
_make_rawFunction · 0.70
find_man_pageMethod · 0.45

Tested by

no test coverage detected