66from typing import Optional , Tuple
77
88import pytest
9- from aiohttp .test_utils import RawTestServer
10- from aioquic .quic .configuration import QuicConfiguration
119from asyncstdlib import sync
12- from cryptography .hazmat .primitives import serialization
1310
1411from reactivestreams .publisher import Publisher
1512from rsocket .awaitable .awaitable_rsocket import AwaitableRSocket
2320from rsocket .rsocket_client import RSocketClient
2421from rsocket .rsocket_server import RSocketServer
2522from rsocket .streams .stream_from_async_generator import StreamFromAsyncGenerator
26- from rsocket .transports .aiohttp_websocket import websocket_handler_factory , TransportAioHttpClient
2723from rsocket .transports .aioquic_transport import rsocket_connect , rsocket_serve
2824from rsocket .transports .tcp import TransportTCP
2925from rsocket .transports .transport import Transport
@@ -244,6 +240,9 @@ async def transport_provider():
244240
245241
246242async def start_websocket_service (waiter : asyncio .Event , container , port : int , generate_test_certificates ):
243+ from rsocket .transports .aiohttp_websocket import websocket_handler_factory , TransportAioHttpClient
244+ from aiohttp .test_utils import RawTestServer
245+
247246 index_iterator = iter (range (1 , 3 ))
248247
249248 def handler_factory (* args , ** kwargs ):
@@ -264,6 +263,8 @@ def on_server_create(server):
264263
265264
266265async def start_websocket_client (port : int , generate_test_certificates ) -> RSocketClient :
266+ from rsocket .transports .aiohttp_websocket import TransportAioHttpClient
267+
267268 url = 'http://localhost:{}' .format (port )
268269
269270 async def transport_provider ():
@@ -281,6 +282,8 @@ async def transport_provider():
281282
282283
283284async def start_quic_service (waiter : asyncio .Event , container , port : int , generate_test_certificates ):
285+ from aioquic .quic .configuration import QuicConfiguration
286+
284287 index_iterator = iter (range (1 , 3 ))
285288 certificate , private_key = generate_test_certificates
286289 server_configuration = QuicConfiguration (
@@ -309,6 +312,9 @@ def on_server_create(server):
309312
310313
311314async def start_quic_client (port : int , generate_test_certificates ) -> RSocketClient :
315+ from aioquic .quic .configuration import QuicConfiguration
316+ from cryptography .hazmat .primitives import serialization
317+
312318 certificate , private_key = generate_test_certificates
313319 client_configuration = QuicConfiguration (
314320 is_client = True
@@ -343,7 +349,7 @@ async def transport_provider():
343349 (
344350 ('tcp' , start_tcp_service , start_tcp_client ),
345351 # ('aiohttp', start_websocket_service, start_websocket_client), # todo: fixme
346- ('quic' , start_quic_service , start_quic_client ),
352+ # ('quic', start_quic_service, start_quic_client), # todo: fixme
347353 )
348354)
349355async def test_connection_failure_during_stream (unused_tcp_port ,
0 commit comments