Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to add doctests or tests for example handle_pill_delete_callback_query? #5

Open
segatrade opened this issue Apr 29, 2021 · 0 comments

Comments

@segatrade
Copy link

segatrade commented Apr 29, 2021

Hello @dkeysil @VKostya ! Thank you for your bot!

Is it possible to add doctests or tests for example handle_pill_delete_callback_query?
I'm trying and get a lot of errors again and again. Stopped on:

 File "C:\pills_bot\tgbot\bot\modules\pills_list\PillsList.py", line 188, in handle
  await callback_query.message.edit_reply_markup(reply_markup=types.InlineKeyboardMarkup())
  File "C:\py379mlvenv64\lib\site-packages\aiogram\types\message.py", line 2706, in edit_reply_markup
    chat_id=self.chat.id, message_id=self.message_id, reply_markup=reply_markup
  File "C:\py379mlvenv64\lib\site-packages\aiogram\bot\bot.py", line 2437, in edit_message_reply_markup
    result = await self.request(api.Methods.EDIT_MESSAGE_REPLY_MARKUP, payload)
  File "C:\py379mlvenv64\lib\site-packages\aiogram\bot\base.py", line 209, in request
    proxy=self.proxy, proxy_auth=self.proxy_auth, timeout=self.timeout, **kwargs)
  File "C:\py379mlvenv64\lib\site-packages\aiogram\bot\api.py", line 140, in make_request
    return check_result(method, response.content_type, response.status, await response.text())
  File "C:\py379mlvenv64\lib\site-packages\aiogram\bot\api.py", line 115, in check_result
    exceptions.BadRequest.detect(description)
  File "C:\py379mlvenv64\lib\site-packages\aiogram\utils\exceptions.py", line 140, in detect
    raise err(cls.text or description)
aiogram.utils.exceptions.MessageNotModified: Message is not modified: specified new message content and reply markup are exactly the same as a current content and reply markup of the message
C:\pills_bot\tgbot\bot\modules\pills_list\PillsList.py:171: UnexpectedException

Also I check aiogram tests for example:

    """ answerCallbackQuery method test """

    async with FakeTelegram(message_data=True):
        result = await bot.answer_callback_query(callback_query_id='QuERyId', text='Test Answer')
        assert isinstance(result, bool)
        assert result is True

It's too different

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant