telebot icon indicating copy to clipboard operation
telebot copied to clipboard

Testing support

Open punyflash opened this issue 3 years ago • 2 comments

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.

punyflash avatar Sep 22 '21 15:09 punyflash

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.

newtmex avatar May 10 '22 08:05 newtmex

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.

punyflash avatar May 24 '22 21:05 punyflash

Most methods support mocking now. Implementing whole replica of bot API is not convenient.

punyflash avatar May 06 '23 05:05 punyflash