MCPcopy
hub / github.com/mitmproxy/mitmproxy / test_make

Function test_make

test/mitmproxy/proxy/test_mode_servers.py:23–45  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

21
22
23def test_make():
24 manager = Mock()
25 context = MagicMock()
26 assert ServerInstance.make("regular", manager)
27
28 for mode in [
29 "regular",
30 # "http3",
31 "upstream:example.com",
32 "transparent",
33 "reverse:example.com",
34 "socks5",
35 ]:
36 inst = ServerInstance.make(mode, manager)
37 assert inst
38 assert inst.make_top_layer(context)
39 assert inst.mode.description
40 assert inst.to_json()
41
42 with pytest.raises(
43 ValueError, match="is not a spec for a WireGuardServerInstance server."
44 ):
45 WireGuardServerInstance.make("regular", manager)
46
47
48async def test_last_exception_and_running(monkeypatch):

Callers

nothing calls this directly

Calls 3

makeMethod · 0.45
make_top_layerMethod · 0.45
to_jsonMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…