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

Function test_command_reply

test/mitmproxy/proxy/test_tutils.py:109–121  ·  view source on GitHub ↗

CommandReplies can use relative offsets to point to the matching command.

(tplaybook)

Source from the content-addressed store, hash-verified

107
108
109def test_command_reply(tplaybook):
110 """CommandReplies can use relative offsets to point to the matching command."""
111 tplaybook >> TEvent()
112 tplaybook << TCommand()
113 tplaybook >> tutils.reply()
114 assert tplaybook
115 assert tplaybook.actual[1] == tplaybook.actual[2].command
116
117 tplaybook >> TEvent((42,))
118 tplaybook << TCommand(42)
119 tplaybook >> tutils.reply(to=TCommand)
120 assert tplaybook
121 assert tplaybook.actual[4] == tplaybook.actual[5].command
122
123
124def test_default_playbook(tctx):

Callers

nothing calls this directly

Calls 2

TEventClass · 0.85
TCommandClass · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…