MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_command_multiple_replies

Function test_command_multiple_replies

test/mitmproxy/proxy/test_tutils.py:157–177  ·  view source on GitHub ↗
(tplaybook, swap)

Source from the content-addressed store, hash-verified

155
156@pytest.mark.parametrize("swap", [False, True])
157def test_command_multiple_replies(tplaybook, swap):
158 a = tutils.Placeholder(int)
159 b = tutils.Placeholder(int)
160
161 command1 = TCommand(a)
162 command2 = TCommand(b)
163
164 tplaybook >> TEvent([1])
165 tplaybook << command1
166 tplaybook >> TEvent([2])
167 tplaybook << command2
168
169 if swap:
170 tplaybook >> tutils.reply(to=command1)
171 tplaybook >> tutils.reply(to=command2)
172 else:
173 tplaybook >> tutils.reply(to=command2)
174 tplaybook >> tutils.reply(to=command1)
175 assert tplaybook
176 assert a() == 1
177 assert b() == 2

Callers

nothing calls this directly

Calls 4

TCommandClass · 0.85
TEventClass · 0.85
aFunction · 0.50
bFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…