'How to create unit test for a Python Telegram Bot
I've built this Telegram Bot in Python, with python-telegram-bot
.
It's not so complex, but I want to do some regression tests to check if everything works fine after a new feature or a change, and more generally to test specific features to find bugs/edge cases.
How can I achieve this?
For now, I'm doing this manually, clicking bot's keyboard and typing some text.
Solution 1:[1]
Have you looked to unit tests that are present in python-telegram-bot library? I think it is a good place to start.
For example, in this file you can see how to test a dialog with bot that uses ConversationHandler
.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | wowkin2 |