telebot
telebot copied to clipboard
Testing support
Discussed in https://github.com/westacks/telebot/discussions/27
Originally posted by roelofr September 21, 2021 Hey there,
I just discovered this package via my GitHub homepage (I didn't know it did that).
It looks great, but I'm seeing no docs on testing from an end-user perspective (which is something a lot of Telegram bot packages don't have).
What would be the best way to test this, I'd be glad to help.
I think the way to test this would be to have a complete end-to-end testing setup.
I have had this thought before, but in a different form.
I write unit and feature tests, I would love to fake the sending of messages with telebot, just the way we can fake sending mails or dispatching of events.
I think the way to test this would be to have a complete end-to-end testing setup.
I have had this thought before, but in a different form.
I write unit and feature tests, I would love to fake the sending of messages with telebot, just the way we can fake sending mails or dispatching of events.
Well, this is the way I'm trying to implement right now and this is not feel right so far - there is no way to check if you're giving proper request parameters and data flow is just makes no sense. I do believe that the correct way would be something like in telegram-test-api
, but this is tons of work to do - I will die trying to support this.
Most methods support mocking now. Implementing whole replica of bot API is not convenient.