3

I'm currently using python-telegram-bot for create telegram bot. But every change I made, I have to do feature test by my hands. How can I create a unit test for a telegram bot using a tool such as pytest or unittest?

Is there a way to generate the same traffic without telegram or control telegram in a terminal environment for test my telegram bot?

Using python3, the latest version of python-telegram-bot

Henry Kim
  • 575
  • 4
  • 19

1 Answers1

1

You should to create JSON with real data from user. Then use requests to send a test messages to the your server endpoint.
To get a valid JSON data you can save update object.

dzNET
  • 930
  • 1
  • 9
  • 14