git reimport
This commit is contained in:
28
tests/zvk/util/test_download.py
Normal file
28
tests/zvk/util/test_download.py
Normal file
@@ -0,0 +1,28 @@
|
||||
import pytest
|
||||
|
||||
from zvk.event.consumer import on_startup
|
||||
from zvk.util.download import download_file
|
||||
from zvk.util.zlogging import logger
|
||||
|
||||
|
||||
@on_startup
|
||||
async def test_action(bot, net, db):
|
||||
filename = await download_file(
|
||||
db,
|
||||
net,
|
||||
'https://www.google.com/images/branding/googlelogo/2x/googlelogo_color_272x92dp.png',
|
||||
)
|
||||
logger.info(f'{filename}')
|
||||
filename = await download_file(
|
||||
db,
|
||||
net,
|
||||
'https://yastatic.net/www/_/x/Q/xk8YidkhGjIGOrFm_dL5781YA.svg',
|
||||
)
|
||||
logger.info(f'{filename}')
|
||||
|
||||
|
||||
@pytest.mark.asyncio
|
||||
async def test_download(bot):
|
||||
bot.event_queue.register_consumer(test_action)
|
||||
|
||||
assert await bot.run()
|
Reference in New Issue
Block a user