MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_parse_partial

Method test_parse_partial

test/mitmproxy/test_command.py:116–548  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

114 assert c.call(["1"]) == 1
115
116 def test_parse_partial(self):
117 tests = [
118 [
119 "foo bar",
120 [
121 command.ParseResult(
122 value="foo", type=mitmproxy.types.Cmd, valid=False
123 ),
124 command.ParseResult(
125 value=" ", type=mitmproxy.types.Space, valid=True
126 ),
127 command.ParseResult(
128 value="bar", type=mitmproxy.types.Unknown, valid=False
129 ),
130 ],
131 [],
132 ],
133 [
134 "cmd1 'bar",
135 [
136 command.ParseResult(
137 value="cmd1", type=mitmproxy.types.Cmd, valid=True
138 ),
139 command.ParseResult(
140 value=" ", type=mitmproxy.types.Space, valid=True
141 ),
142 command.ParseResult(value="'bar", type=str, valid=True),
143 ],
144 [],
145 ],
146 [
147 "a",
148 [command.ParseResult(value="a", type=mitmproxy.types.Cmd, valid=False)],
149 [],
150 ],
151 [
152 "",
153 [],
154 [
155 command.CommandParameter("", mitmproxy.types.Cmd),
156 command.CommandParameter("", mitmproxy.types.CmdArgs),
157 ],
158 ],
159 [
160 "cmd3 1",
161 [
162 command.ParseResult(
163 value="cmd3", type=mitmproxy.types.Cmd, valid=True
164 ),
165 command.ParseResult(
166 value=" ", type=mitmproxy.types.Space, valid=True
167 ),
168 command.ParseResult(value="1", type=int, valid=True),
169 ],
170 [],
171 ],
172 [
173 "cmd3 ",

Callers

nothing calls this directly

Calls 4

contextMethod · 0.80
parse_partialMethod · 0.80
TAddonClass · 0.70
addMethod · 0.45

Tested by

no test coverage detected