Use aiofiles where relevant.

This commit is contained in:
grossmj committed 2019-03-06 23:00:01 +07:00
1 parent b0df7ecabf
commit af80b0bb6e
17 files changed
+90 -234

No files matched your search

+2 -2
View File
@@ -34,11 +34,11 @@ def test_response_file(async_run, tmpdir, response):
with open(filename, 'w+') as f:
f.write('world')
async_run(response.file(filename))
async_run(response.stream_file(filename))
assert response.status == 200
def test_response_file_not_found(async_run, tmpdir, response):
filename = str(tmpdir / 'hello-not-found')
pytest.raises(HTTPNotFound, lambda: async_run(response.file(filename)))
pytest.raises(HTTPNotFound, lambda: async_run(response.stream_file(filename)))