mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
fix: use ChatMemberFactory instead of the direct class
This commit is contained in:
parent
36c70577bf
commit
bb2ab6ff63
6 changed files with 9 additions and 9 deletions
|
|
@ -96,7 +96,7 @@ include_trailing_comma = true
|
|||
force_grid_wrap = 0
|
||||
use_parentheses = true
|
||||
line_length = 99
|
||||
known_third_party = ["aiofiles", "aiohttp", "aiohttp_socks", "aresponses", "async_lru", "packaging", "pkg_resources", "pydantic", "pytest"]
|
||||
known_third_party = ["aiofiles", "aiohttp", "aiohttp_socks", "aresponses", "async_lru", "factory", "packaging", "poetry", "pydantic", "pytest", "typing_extensions"]
|
||||
|
||||
[build-system]
|
||||
requires = ["poetry>=0.12"]
|
||||
|
|
|
|||
|
|
@ -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()
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue