mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-11-03 05:51:15 +02:00
Fix tests to work with new version of aiohttp (>= 3.0)
This commit is contained in:
1 parent
9ae9209881
commit
ab8dc52ece
18 files changed
+218
-184
No files matched your search
@@ -420,9 +420,8 @@ class NodeHandler:
|
||||
response.content_type = "application/octet-stream"
|
||||
response.enable_chunked_encoding()
|
||||
await response.prepare(request)
|
||||
|
||||
response.write(res.body)
|
||||
await response.write_eof()
|
||||
await response.write(res.body)
|
||||
# await response.write_eof() #FIXME: shound't be needed anymore
|
||||
|
||||
@Route.post(
|
||||
r"/projects/{project_id}/nodes/{node_id}/files/{path:.+}",
|
||||
|
||||
@@ -52,10 +52,9 @@ class NotificationHandler:
|
||||
while True:
|
||||
try:
|
||||
msg = await queue.get_json(5)
|
||||
response.write(("{}\n".format(msg)).encode("utf-8"))
|
||||
await response.write(("{}\n".format(msg)).encode("utf-8"))
|
||||
except asyncio.futures.CancelledError:
|
||||
break
|
||||
await response.drain()
|
||||
|
||||
@Route.get(
|
||||
r"/notifications/ws",
|
||||
|
||||
@@ -231,10 +231,9 @@ class ProjectHandler:
|
||||
while True:
|
||||
try:
|
||||
msg = await queue.get_json(5)
|
||||
response.write(("{}\n".format(msg)).encode("utf-8"))
|
||||
await response.write(("{}\n".format(msg)).encode("utf-8"))
|
||||
except asyncio.futures.CancelledError as e:
|
||||
break
|
||||
await response.drain()
|
||||
|
||||
if project.auto_close:
|
||||
# To avoid trouble with client connecting disconnecting we sleep few seconds before checking
|
||||
@@ -313,10 +312,9 @@ class ProjectHandler:
|
||||
await response.prepare(request)
|
||||
|
||||
for data in stream:
|
||||
response.write(data)
|
||||
await response.drain()
|
||||
await response.write(data)
|
||||
|
||||
await response.write_eof()
|
||||
#await response.write_eof() #FIXME: shound't be needed anymore
|
||||
# Will be raise if you have no space left or permission issue on your temporary directory
|
||||
# RuntimeError: something was wrong during the zip process
|
||||
except (ValueError, OSError, RuntimeError) as e:
|
||||
|
||||
Reference in new issue
Block a user