fix: use ChatMemberFactory instead of the direct class

This commit is contained in:
Egor 2020-07-03 16:32:26 +05:00
parent 36c70577bf
commit bb2ab6ff63
6 changed files with 9 additions and 9 deletions

View file

@ -12,7 +12,7 @@ class TestGetChatAdministrators:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetChatAdministrators, ok=True, result=[ChatMemberFactory(status="creator")],
GetChatAdministrators, ok=True, result=[ChatMemberFactory(status="creator")]
)
response: List[ChatMember] = await GetChatAdministrators(chat_id=-42)
@ -23,7 +23,7 @@ class TestGetChatAdministrators:
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetChatAdministrators, ok=True, result=[ChatMemberFactory(status="creator")],
GetChatAdministrators, ok=True, result=[ChatMemberFactory(status="creator")]
)
response: List[ChatMember] = await bot.get_chat_administrators(chat_id=-42)
request: Request = bot.get_request()

View file

@ -11,7 +11,7 @@ class TestGetChatMember:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetChatMember, ok=True, result=ChatMemberFactory(status="creator"),
GetChatMember, ok=True, result=ChatMemberFactory(status="creator")
)
response: ChatMember = await GetChatMember(chat_id=-42, user_id=42)
@ -22,7 +22,7 @@ class TestGetChatMember:
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetChatMember, ok=True, result=ChatMemberFactory(status="creator"),
GetChatMember, ok=True, result=ChatMemberFactory(status="creator")
)
response: ChatMember = await bot.get_chat_member(chat_id=-42, user_id=42)