chore: make aresponses clear

This commit is contained in:
Oleg A 2023-09-23 08:49:21 +03:00
parent 8076cc2bf7
commit acf8c1b8f4
No known key found for this signature in database
GPG key ID: 5FE046817A9657C5

View file

@ -88,10 +88,8 @@ class TestBot:
async def test_download_file(self, aresponses: ResponsesMockServer):
aresponses.add(
aresponses.ANY,
aresponses.ANY,
"get",
aresponses.Response(status=200, body=b"\f" * 10),
method_pattern="get",
response=aresponses.Response(status=200, body=b"\f" * 10),
)
# https://github.com/Tinche/aiofiles#writing-tests-for-aiofiles
@ -112,12 +110,9 @@ class TestBot:
aresponses: ResponsesMockServer,
):
aresponses.add(
aresponses.ANY,
aresponses.ANY,
"get",
aresponses.Response(status=200, body=b"\f" * 10),
method_pattern="get",
response=aresponses.Response(status=200, body=b"\f" * 10),
)
result = await bot.download_file("TEST")
assert isinstance(result, io.BytesIO)
@ -129,12 +124,9 @@ class TestBot:
aresponses: ResponsesMockServer,
):
aresponses.add(
aresponses.ANY,
aresponses.ANY,
"get",
aresponses.Response(status=200, body=b"\f" * 10),
method_pattern="get",
response=aresponses.Response(status=200, body=b"\f" * 10),
)
custom = io.BytesIO()
result = await bot.download_file("TEST", custom)