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

Function test_udp_start_error

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

Source from the content-addressed store, hash-verified

346
347
348async def test_udp_start_error():
349 manager = MagicMock()
350
351 with taddons.context():
352 inst = ServerInstance.make("reverse:udp://127.0.0.1:1234@127.0.0.1:0", manager)
353 await inst.start()
354 port = inst.listen_addrs[0][1]
355 inst2 = ServerInstance.make(
356 f"reverse:udp://127.0.0.1:1234@127.0.0.1:{port}", manager
357 )
358 with pytest.raises(
359 Exception, match=f"Failed to bind UDP socket to 127.0.0.1:{port}"
360 ):
361 await inst2.start()
362 await inst.stop()
363
364
365@pytest.mark.parametrize("ip_version", ["v4", "v6"])

Callers

nothing calls this directly

Calls 4

contextMethod · 0.80
makeMethod · 0.45
startMethod · 0.45
stopMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…