MCPcopy
hub / github.com/mitmproxy/mitmproxy / TAddon

Class TAddon

test/mitmproxy/test_command.py:16–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14
15
16class TAddon:
17 @command.command("cmd1")
18 def cmd1(self, foo: str) -> str:
19 """cmd1 help"""
20 return "ret " + foo
21
22 @command.command("cmd2")
23 def cmd2(self, foo: str) -> str:
24 return 99
25
26 @command.command("cmd3")
27 def cmd3(self, foo: int) -> int:
28 return foo
29
30 @command.command("cmd4")
31 def cmd4(self, a: int, b: str, c: mitmproxy.types.Path) -> str:
32 return "ok"
33
34 @command.command("subcommand")
35 def subcommand(
36 self, cmd: mitmproxy.types.Cmd, *args: mitmproxy.types.CmdArgs
37 ) -> str:
38 return "ok"
39
40 @command.command("empty")
41 def empty(self) -> None:
42 pass
43
44 @command.command("varargs")
45 def varargs(self, one: str, *var: str) -> Sequence[str]:
46 return list(var)
47
48 def choices(self) -> Sequence[str]:
49 return ["one", "two", "three"]
50
51 @command.argument("arg", type=mitmproxy.types.Choice("choices"))
52 def choose(self, arg: str) -> Sequence[str]:
53 return ["one", "two", "three"]
54
55 @command.command("path")
56 def path(self, arg: mitmproxy.types.Path) -> None:
57 pass
58
59 @command.command("flow")
60 def flow(self, f: Flow, s: str) -> None:
61 pass
62
63
64class Unsupported:

Callers 4

test_varargsMethod · 0.70
test_callMethod · 0.70
test_parse_partialMethod · 0.70
test_simpleFunction · 0.70

Calls

no outgoing calls

Tested by 4

test_varargsMethod · 0.56
test_callMethod · 0.56
test_parse_partialMethod · 0.56
test_simpleFunction · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…