|
8 | 8 |
|
9 | 9 | ############################## LISTS USED TO PARAMETERIZE TESTS ##############################
|
10 | 10 | from corehttp.rest import HttpRequest as RestHttpRequest
|
11 |
| -from corehttp.transport.requests import RequestsTransport |
12 |
| -from corehttp.transport.httpx import HttpXTransport, AsyncHttpXTransport |
13 |
| -from corehttp.transport.aiohttp import AioHttpTransport |
14 | 11 |
|
15 | 12 |
|
16 |
| -SYNC_TRANSPORTS = [RequestsTransport, HttpXTransport] |
17 |
| -ASYNC_TRANSPORTS = [AioHttpTransport, AsyncHttpXTransport] |
| 13 | +SYNC_TRANSPORTS = [] |
| 14 | +ASYNC_TRANSPORTS = [] |
18 | 15 |
|
19 |
| -HTTP_REQUESTS = [RestHttpRequest] |
| 16 | +AIOHTTP_TRANSPORT_RESPONSES = [] |
20 | 17 | REQUESTS_TRANSPORT_RESPONSES = []
|
21 | 18 |
|
22 |
| -from corehttp.rest._http_response_impl import HttpResponseImpl as RestHttpResponse |
23 |
| - |
24 |
| -HTTP_RESPONSES = [RestHttpResponse] |
| 19 | +try: |
| 20 | + from corehttp.rest._requests_basic import RestRequestsTransportResponse |
| 21 | + from corehttp.transport.requests import RequestsTransport |
25 | 22 |
|
26 |
| -ASYNC_HTTP_RESPONSES = [] |
| 23 | + SYNC_TRANSPORTS.append(RequestsTransport) |
| 24 | + REQUESTS_TRANSPORT_RESPONSES = [RestRequestsTransportResponse] |
| 25 | +except (ImportError, SyntaxError): |
| 26 | + pass |
27 | 27 |
|
28 | 28 | try:
|
29 |
| - from corehttp.rest._http_response_impl_async import AsyncHttpResponseImpl as RestAsyncHttpResponse |
| 29 | + from corehttp.rest._aiohttp import RestAioHttpTransportResponse |
| 30 | + from corehttp.transport.aiohttp import AioHttpTransport |
30 | 31 |
|
31 |
| - ASYNC_HTTP_RESPONSES = [RestAsyncHttpResponse] |
| 32 | + ASYNC_TRANSPORTS.append(AioHttpTransport) |
| 33 | + AIOHTTP_TRANSPORT_RESPONSES = [RestAioHttpTransportResponse] |
32 | 34 | except (ImportError, SyntaxError):
|
33 | 35 | pass
|
34 | 36 |
|
35 | 37 | try:
|
36 |
| - from corehttp.rest._requests_basic import RestRequestsTransportResponse |
| 38 | + from corehttp.transport.httpx import HttpXTransport, AsyncHttpXTransport |
37 | 39 |
|
38 |
| - REQUESTS_TRANSPORT_RESPONSES = [RestRequestsTransportResponse] |
39 |
| -except ImportError: |
| 40 | + SYNC_TRANSPORTS.append(HttpXTransport) |
| 41 | + ASYNC_TRANSPORTS.append(AsyncHttpXTransport) |
| 42 | +except (ImportError, SyntaxError): |
40 | 43 | pass
|
41 | 44 |
|
42 |
| -AIOHTTP_TRANSPORT_RESPONSES = [] |
| 45 | +HTTP_REQUESTS = [RestHttpRequest] |
| 46 | + |
| 47 | +from corehttp.rest._http_response_impl import HttpResponseImpl as RestHttpResponse |
| 48 | + |
| 49 | +HTTP_RESPONSES = [RestHttpResponse] |
| 50 | + |
| 51 | +ASYNC_HTTP_RESPONSES = [] |
43 | 52 |
|
44 | 53 | try:
|
45 |
| - from corehttp.rest._aiohttp import RestAioHttpTransportResponse |
| 54 | + from corehttp.rest._http_response_impl_async import AsyncHttpResponseImpl as RestAsyncHttpResponse |
46 | 55 |
|
47 |
| - AIOHTTP_TRANSPORT_RESPONSES = [RestAioHttpTransportResponse] |
| 56 | + ASYNC_HTTP_RESPONSES = [RestAsyncHttpResponse] |
48 | 57 | except (ImportError, SyntaxError):
|
49 | 58 | pass
|
50 | 59 |
|
|
0 commit comments