chore: lint

This commit is contained in:
Egor 2020-07-03 16:15:37 +05:00
parent d04e220fbb
commit 6e93facffc
8 changed files with 25 additions and 28 deletions

View file

@ -13,7 +13,9 @@ class TestForwardMessage:
prepare_result = bot.add_result_for(
ForwardMessage,
ok=True,
result=Message(message_id=42, date=datetime.datetime.now(), chat=private_chat, text="text", ),
result=Message(
message_id=42, date=datetime.datetime.now(), chat=private_chat, text="text",
),
)
response: Message = await ForwardMessage(
@ -29,7 +31,9 @@ class TestForwardMessage:
prepare_result = bot.add_result_for(
ForwardMessage,
ok=True,
result=Message(message_id=42, date=datetime.datetime.now(), chat=private_chat, text="text", ),
result=Message(
message_id=42, date=datetime.datetime.now(), chat=private_chat, text="text",
),
)
response: Message = await bot.forward_message(

View file

@ -11,9 +11,7 @@ class TestGetChat:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
channel = ChatFactory(type=ChatType.CHANNEL)
prepare_result = bot.add_result_for(
GetChat, ok=True, result=channel
)
prepare_result = bot.add_result_for(GetChat, ok=True, result=channel)
response: Chat = await GetChat(chat_id=channel.id)
request: Request = bot.get_request()
@ -23,9 +21,7 @@ class TestGetChat:
@pytest.mark.asyncio
async def test_bot_method(self, bot: MockedBot):
channel = ChatFactory(type=ChatType.CHANNEL)
prepare_result = bot.add_result_for(
GetChat, ok=True, result=channel
)
prepare_result = bot.add_result_for(GetChat, ok=True, result=channel)
response: Chat = await bot.get_chat(chat_id=channel.id)
request: Request = bot.get_request()

View file

@ -12,11 +12,7 @@ class TestGetChatAdministrators:
@pytest.mark.asyncio
async def test_method(self, bot: MockedBot):
prepare_result = bot.add_result_for(
GetChatAdministrators,
ok=True,
result=[
ChatMember(status="creator")
],
GetChatAdministrators, ok=True, result=[ChatMember(status="creator")],
)
response: List[ChatMember] = await GetChatAdministrators(chat_id=-42)
@ -27,11 +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=[
ChatMember(status="creator")
],
GetChatAdministrators, ok=True, result=[ChatMember(status="creator")],
)
response: List[ChatMember] = await bot.get_chat_administrators(chat_id=-42)
request: Request = bot.get_request()

View file

@ -21,7 +21,9 @@ class TestSendContact:
),
)
response: Message = await SendContact(chat_id=private_chat.id, phone_number="911", first_name="911")
response: Message = await SendContact(
chat_id=private_chat.id, phone_number="911", first_name="911"
)
request: Request = bot.get_request()
assert request.method == "sendContact"
assert response == prepare_result.result

View file

@ -21,7 +21,9 @@ class TestSendLocation:
),
)
response: Message = await SendLocation(chat_id=private_chat.id, latitude=3.14, longitude=3.14)
response: Message = await SendLocation(
chat_id=private_chat.id, latitude=3.14, longitude=3.14
)
request: Request = bot.get_request()
assert request.method == "sendLocation"
assert response == prepare_result.result
@ -39,7 +41,9 @@ class TestSendLocation:
),
)
response: Message = await bot.send_location(chat_id=private_chat.id, latitude=3.14, longitude=3.14)
response: Message = await bot.send_location(
chat_id=private_chat.id, latitude=3.14, longitude=3.14
)
request: Request = bot.get_request()
assert request.method == "sendLocation"
assert response == prepare_result.result