MCPcopy Index your code
hub / github.com/mitmproxy/mitmproxy / test_collect_commands

Function test_collect_commands

test/mitmproxy/test_command.py:656–669  ·  view source on GitHub ↗

This tests for errors thrown by getattr() or __getattr__ implementations that return an object for .command_name.

(caplog)

Source from the content-addressed store, hash-verified

654
655
656async def test_collect_commands(caplog):
657 """
658 This tests for errors thrown by getattr() or __getattr__ implementations
659 that return an object for .command_name.
660 """
661 with taddons.context() as tctx:
662 c = command.CommandManager(tctx.master)
663 a = TCmds()
664 c.collect_commands(a)
665 assert "empty" in c.commands
666
667 a = TypeErrAddon()
668 c.collect_commands(a)
669 assert "Could not load" in caplog.text
670
671
672def test_decorator():

Callers

nothing calls this directly

Calls 4

collect_commandsMethod · 0.95
TCmdsClass · 0.85
TypeErrAddonClass · 0.85
contextMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…