changes in test
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
__version__ = '0.0.7'
|
__version__ = '0.0.7'
|
||||||
__title__ = "Pisya_bot"
|
__title__ = "bot"
|
||||||
__author__ = "baconborn"
|
__author__ = "baconborn"
|
||||||
|
|
||||||
from typing import NamedTuple, Literal
|
from typing import NamedTuple, Literal
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ from bot.lib.CogsPrep import cog_list, work_with_cogs
|
|||||||
|
|
||||||
|
|
||||||
def test_cog_list():
|
def test_cog_list():
|
||||||
with mock.patch('lib.CogsPrep.listdir') as MockClass:
|
with mock.patch('bot.lib.CogsPrep.listdir') as MockClass:
|
||||||
MockClass.return_value = ['cog1.py', 'cog2.py']
|
MockClass.return_value = ['cog1.py', 'cog2.py']
|
||||||
result = cog_list()
|
result = cog_list()
|
||||||
assert result == ['cog1', 'cog2']
|
assert result == ['cog1', 'cog2']
|
||||||
@@ -21,7 +21,7 @@ def test_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):
|
||||||
with (mock.patch('lib.CogsPrep.rename') as mock_rename):
|
with (mock.patch('bot.lib.CogsPrep.rename') as mock_rename):
|
||||||
mock_rename.return_value = None
|
mock_rename.return_value = None
|
||||||
mock_bot = mock.MagicMock(spec=CommonBotBase)
|
mock_bot = mock.MagicMock(spec=CommonBotBase)
|
||||||
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