File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,35 @@ async def handler(request):
69
69
assert africa ["code" ] == "AF"
70
70
71
71
72
+ @pytest .mark .asyncio
73
+ async def test_aiohttp_ignore_backend_content_type (event_loop , aiohttp_server ):
74
+ from aiohttp import web
75
+ from gql .transport .aiohttp import AIOHTTPTransport
76
+
77
+ async def handler (request ):
78
+ return web .Response (text = query1_server_answer , content_type = "text/plain" )
79
+
80
+ app = web .Application ()
81
+ app .router .add_route ("POST" , "/" , handler )
82
+ server = await aiohttp_server (app )
83
+
84
+ url = server .make_url ("/" )
85
+
86
+ sample_transport = AIOHTTPTransport (url = url , timeout = 10 )
87
+
88
+ async with Client (transport = sample_transport ,) as session :
89
+
90
+ query = gql (query1_str )
91
+
92
+ result = await session .execute (query )
93
+
94
+ continents = result ["continents" ]
95
+
96
+ africa = continents [0 ]
97
+
98
+ assert africa ["code" ] == "AF"
99
+
100
+
72
101
@pytest .mark .asyncio
73
102
async def test_aiohttp_cookies (event_loop , aiohttp_server ):
74
103
from aiohttp import web
You can’t perform that action at this time.
0 commit comments