Tests: pathlib used where appropriate

Also fixed various pylint errors and style issues.
This commit is contained in:
Andrei Zeliankou
2024-01-15 15:48:58 +00:00
parent e95a91cbfa
commit 5a8337933d
72 changed files with 306 additions and 256 deletions

View File

@@ -3,7 +3,7 @@ import os
async def handler(prefix, scope, receive, send):
if scope['type'] == 'lifespan':
with open(f'{prefix}version', 'w+') as f:
with open(f'{prefix}version', 'w+', encoding='utf-8') as f:
f.write(
f"{scope['asgi']['version']} {scope['asgi']['spec_version']}"
)

View File

@@ -6,6 +6,6 @@ async def application(scope, receive, send):
await send({"type": "lifespan.startup.failed"})
raise Exception('Exception blah')
elif message['type'] == 'lifespan.shutdown':
if message['type'] == 'lifespan.shutdown':
await send({'type': 'lifespan.shutdown.complete'})
return