uptated requrements.txt
This commit is contained in:
@@ -8,8 +8,6 @@ work_with_cogs: loads, reloads and unloads cogs files
|
|||||||
"""
|
"""
|
||||||
from os import listdir, rename
|
from os import listdir, rename
|
||||||
|
|
||||||
from disnake.ext.commands import Bot
|
|
||||||
|
|
||||||
from .Logger import logger
|
from .Logger import logger
|
||||||
|
|
||||||
|
|
||||||
@@ -22,7 +20,7 @@ def cog_list(fold: str = './cogs') -> list:
|
|||||||
|
|
||||||
|
|
||||||
async def work_with_cogs(what_do: str,
|
async def work_with_cogs(what_do: str,
|
||||||
bot: Bot,
|
bot,
|
||||||
cog: str | list):
|
cog: str | list):
|
||||||
if isinstance(cog, str):
|
if isinstance(cog, str):
|
||||||
cog = cog.split()
|
cog = cog.split()
|
||||||
|
|||||||
@@ -19,9 +19,10 @@ def test_cog_list(mock_cog_list):
|
|||||||
@pytest.mark.parametrize("cog", ["cog1.py", "cog2"])
|
@pytest.mark.parametrize("cog", ["cog1.py", "cog2"])
|
||||||
@pytest.mark.parametrize("what_do", ['load', 'unload', 'reload', 'disable', 'enable'])
|
@pytest.mark.parametrize("what_do", ['load', 'unload', 'reload', 'disable', 'enable'])
|
||||||
async def test_work_with_cogs(what_do, cog):
|
async def test_work_with_cogs(what_do, cog):
|
||||||
mock_logger = mock.MagicMock()
|
mock_logger = mock.AsyncMock()
|
||||||
with mock.patch('discord_bot.lib.CogsPrep.logger.info') as mocked_logger:
|
with (mock.patch('discord_bot.lib.CogsPrep.logger.info') as mocked_logger):
|
||||||
mock_bot = mock.MagicMock(spec=Bot)
|
mock_bot = mock.AsyncMock()
|
||||||
|
await mock_bot(spec=Bot)
|
||||||
with mock.patch('discord_bot.lib.CogsPrep.rename') as mock_rename:
|
with mock.patch('discord_bot.lib.CogsPrep.rename') as mock_rename:
|
||||||
mock_rename.return_value = True
|
mock_rename.return_value = True
|
||||||
result = await work_with_cogs(what_do, mock_bot, cog)
|
result = await work_with_cogs(what_do, mock_bot, cog)
|
||||||
|
|||||||
Reference in New Issue
Block a user