MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_placeholder

Function test_placeholder

test/mitmproxy/proxy/test_tutils.py:77–86  ·  view source on GitHub ↗

Developers can specify placeholders for yet unknown attributes.

(tplaybook, typed)

Source from the content-addressed store, hash-verified

75
76@pytest.mark.parametrize("typed", [True, False])
77def test_placeholder(tplaybook, typed):
78 """Developers can specify placeholders for yet unknown attributes."""
79 if typed:
80 f = tutils.Placeholder(int)
81 else:
82 f = tutils.Placeholder()
83 tplaybook >> TEvent([42])
84 tplaybook << TCommand(f)
85 assert tplaybook
86 assert f() == 42
87
88
89def test_placeholder_type_mismatch(tplaybook):

Callers

nothing calls this directly

Calls 3

TEventClass · 0.85
TCommandClass · 0.85
fFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…