Update test_lib_Cog.py
This commit is contained in:
@@ -5,12 +5,11 @@ from mock import mock
|
|||||||
from ..lib.CogsPrep import cog_list, work_with_cogs
|
from ..lib.CogsPrep import cog_list, work_with_cogs
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.asyncio
|
|
||||||
@mock.patch('discord_bot.lib.CogsPrep.cog_list')
|
@mock.patch('discord_bot.lib.CogsPrep.cog_list')
|
||||||
async def test_cog_list(mock_cog_list):
|
async def test_cog_list(mock_cog_list):
|
||||||
with mock.patch('discord_bot.lib.CogsPrep.listdir') as MockClass:
|
with mock.patch('discord_bot.lib.CogsPrep.listdir') as MockClass:
|
||||||
MockClass.return_value = ['cog1.py', 'cog2.py']
|
MockClass.return_value = ['cog1.py', 'cog2.py']
|
||||||
result = await cog_list()
|
result = cog_list()
|
||||||
assert result == ['cog1', 'cog2']
|
assert result == ['cog1', 'cog2']
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user