MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_call

Method test_call

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

Source from the content-addressed store, hash-verified

99 assert c.call(["one", "two", "three"]) == ["two", "three"]
100
101 def test_call(self):
102 with taddons.context() as tctx:
103 cm = command.CommandManager(tctx.master)
104 a = TAddon()
105 c = command.Command(cm, "cmd.path", a.cmd1)
106 assert c.call(["foo"]) == "ret foo"
107 assert c.signature_help() == "cmd.path foo -> str"
108
109 c = command.Command(cm, "cmd.two", a.cmd2)
110 with pytest.raises(exceptions.CommandError):
111 c.call(["foo"])
112
113 c = command.Command(cm, "cmd.three", a.cmd3)
114 assert c.call(["1"]) == 1
115
116 def test_parse_partial(self):
117 tests = [

Callers

nothing calls this directly

Calls 4

callMethod · 0.95
signature_helpMethod · 0.95
contextMethod · 0.80
TAddonClass · 0.70

Tested by

no test coverage detected