MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_decorator

Function test_decorator

test/mitmproxy/test_command.py:672–684  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

670
671
672def test_decorator():
673 with taddons.context() as tctx:
674 c = command.CommandManager(tctx.master)
675 a = TDec()
676 c.collect_commands(a)
677 assert "cmd1" in c.commands
678 assert c.execute("cmd1 bar") == "ret bar"
679 assert "empty" in c.commands
680 assert c.execute("empty") is None
681
682 with taddons.context() as tctx:
683 tctx.master.addons.add(a)
684 assert tctx.master.commands.execute("cmd1 bar") == "ret bar"
685
686
687def test_verify_arg_signature():

Callers

nothing calls this directly

Calls 5

collect_commandsMethod · 0.95
executeMethod · 0.95
TDecClass · 0.85
contextMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…