MCPcopy Create free account
hub / github.com/mitmproxy/mitmproxy / _test_echo

Function _test_echo

test/mitmproxy/proxy/layers/quic/test__stream_layers.py:436–452  ·  view source on GitHub ↗
(
    playbook: tutils.Playbook, tssl: SSLTest, conn: connection.Connection
)

Source from the content-addressed store, hash-verified

434
435
436def _test_echo(
437 playbook: tutils.Playbook, tssl: SSLTest, conn: connection.Connection
438) -> None:
439 tssl.quic.send_datagram_frame(b"Hello World")
440 data = tutils.Placeholder(bytes)
441 assert (
442 playbook
443 >> events.DataReceived(conn, tssl.read())
444 << commands.SendData(conn, data)
445 )
446 tssl.write(data())
447 while event := tssl.quic.next_event():
448 if isinstance(event, quic_events.DatagramFrameReceived):
449 assert event.data == b"hello world"
450 break
451 else:
452 raise AssertionError()
453
454
455def finish_handshake(

Callers 3

test_simpleMethod · 0.70
test_client_onlyMethod · 0.70
test_server_requiredMethod · 0.70

Calls 4

dataFunction · 0.85
next_eventMethod · 0.80
readMethod · 0.45
writeMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…