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

Function test_expect

test/mitmproxy/proxy/test_utils.py:7–22  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6
7def test_expect():
8 class Foo:
9 @expect(str, int)
10 def foo(self, x):
11 return "".join(reversed(x))
12
13 @expect(str)
14 def bar(self, x):
15 yield "".join(reversed(x))
16
17 f = Foo()
18
19 assert f.foo("foo") == "oof"
20 assert list(f.bar("bar")) == ["rab"]
21 with pytest.raises(AssertionError, match=r"Expected str\|int, got None."):
22 f.foo(None)
23
24
25def test_receive_buffer():

Callers

nothing calls this directly

Calls 3

fooMethod · 0.95
barMethod · 0.95
FooClass · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…