(
test_conf: TConf,
)
| 861 | ], |
| 862 | ) |
| 863 | def test_next_layer( |
| 864 | test_conf: TConf, |
| 865 | ): |
| 866 | nl = NextLayer() |
| 867 | with taddons.context(nl) as tctx: |
| 868 | tctx.configure( |
| 869 | nl, |
| 870 | ignore_hosts=test_conf.ignore_hosts, |
| 871 | tcp_hosts=test_conf.tcp_hosts, |
| 872 | udp_hosts=test_conf.udp_hosts, |
| 873 | ) |
| 874 | |
| 875 | ctx = Context( |
| 876 | Client( |
| 877 | peername=("192.168.0.42", 51234), |
| 878 | sockname=("0.0.0.0", 8080), |
| 879 | alpn=test_conf.alpn, |
| 880 | ), |
| 881 | tctx.options, |
| 882 | ) |
| 883 | ctx.server.address = test_conf.server_address |
| 884 | ctx.client.transport_protocol = test_conf.transport_protocol |
| 885 | ctx.client.tls_version = test_conf.tls_version |
| 886 | ctx.client.proxy_mode = ProxyMode.parse(test_conf.proxy_mode) |
| 887 | ctx.layers = [x(ctx) for x in test_conf.before] |
| 888 | nl._next_layer( |
| 889 | ctx, |
| 890 | data_client=test_conf.data_client, |
| 891 | data_server=test_conf.data_server, |
| 892 | ) |
| 893 | assert stack_match(ctx, test_conf.after), f"Unexpected stack: {ctx.layers}" |
| 894 | |
| 895 | last_layer = ctx.layers[-1] |
| 896 | if isinstance(last_layer, (UDPLayer, TCPLayer)): |
| 897 | assert bool(last_layer.flow) ^ test_conf.ignore_conn |
| 898 | |
| 899 | |
| 900 | def test_starts_like_quic(): |
nothing calls this directly
no test coverage detected
searching dependent graphs…