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

Function create_test_store

tests/helpers.py:18–263  ·  view source on GitHub ↗

Build a real Store backed by in-memory SQLite with standard test fixtures.

()

Source from the content-addressed store, hash-verified

16
17
18def create_test_store() -> Store:
19 """Build a real Store backed by in-memory SQLite with standard test fixtures."""
20 store = Store.create(":memory:")
21
22 opts = [
23 Option(text="-a desc", short=["-a"], long=["--a"], has_argument=False),
24 Option(text="-b <arg> desc", short=["-b"], long=["--b"], has_argument=True),
25 Option(text="-? help text", short=["-?"], long=[], has_argument=False),
26 Option(
27 text="-c=one,two\ndesc",
28 short=["-c"],
29 long=[],
30 has_argument=["one", "two"],
31 ),
32 ]
33
34 store.add_manpage(
35 ParsedManpage(
36 source="ubuntu/26.04/1/bar.1.gz",
37 name="bar",
38 synopsis="bar synopsis",
39 options=opts,
40 aliases=[("bar", 10)],
41 subcommands=["foo"],
42 ),
43 _ROFF_RAW,
44 )
45 store.add_manpage(
46 ParsedManpage(
47 source="ubuntu/26.04/1/baz.1.gz",
48 name="baz",
49 synopsis="baz synopsis",
50 options=opts,
51 aliases=[("baz", 10)],
52 dashless_opts=True,
53 ),
54 _ROFF_RAW,
55 )
56 store.add_manpage(
57 ParsedManpage(
58 source="ubuntu/26.04/1/bar-foo.1.gz",
59 name="bar-foo",
60 synopsis="bar foo synopsis",
61 options=opts,
62 aliases=[("bar foo", 10)],
63 dashless_opts=True,
64 ),
65 _ROFF_RAW,
66 )
67 store.add_manpage(
68 ParsedManpage(
69 source="ubuntu/26.04/1/nosynopsis.1.gz",
70 name="nosynopsis",
71 synopsis=None,
72 options=opts,
73 aliases=[("nosynopsis", 10)],
74 ),
75 _ROFF_RAW,

Callers 4

setUpMethod · 0.90
setUpMethod · 0.90
setUpMethod · 0.90
helpers.pyFile · 0.85

Calls 4

OptionClass · 0.90
ParsedManpageClass · 0.90
add_manpageMethod · 0.80
createMethod · 0.45

Tested by 3

setUpMethod · 0.72
setUpMethod · 0.72
setUpMethod · 0.72