Skip to content

Conversation

@jainamoswal
Copy link
Contributor

@jainamoswal jainamoswal commented Jul 19, 2025

closes #4867

@Bibo-Joshi
Copy link
Member

Hi @jainamoswal may I ask what's your status here? do you need help with anything?

@jainamoswal
Copy link
Contributor Author

I'm still figuring out about adding the tests regarding the code I added. @Bibo-Joshi

@aelkheir
Copy link
Member

So there are a couple of things we'd want to test here.

  • that calling message.delete actually calls the correct bot method depending on message.business_connection_id
  • that we correctly wrap message.id in a list; in the case that business_connection_id is present.
  • finally, test that the shortcut signature matches the bot's one, and correctly passes the shortcut'ed parameters.

The way i'd approach this is to monkeypatch one level higher than the bot methods. (i.e request.post for example). you can have a look at test_business_methods.py for examples on monkeypatch.

Then we'd also need to have two test message objects, possibly as a parameterized fixture, you can also search the codebase or pytest docs for those. once that is done, we can modify the test behavior and expectations based on the type of the message.

shoot me any questions if some parts aren't clear.

@Bibo-Joshi
Copy link
Member

@jainamoswal are you still interested in working on this? Do you need additional support with the tests?

@Bibo-Joshi
Copy link
Member

I will take this as a no. @aelkheir would you like to continue work on this, possibly after the api update is finished? :)

@aelkheir
Copy link
Member

aelkheir commented Sep 7, 2025

Apologies @jainamoswal, something went wrong my side and i had to force push.

@aelkheir aelkheir added the 📋 pending-review work status: pending-review label Sep 7, 2025
Copy link
Member

@Bibo-Joshi Bibo-Joshi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for supporting @aelkheir ! If there is nothing left from your side I'd say this is good to merge :)

@Bibo-Joshi Bibo-Joshi merged commit 0790bd8 into python-telegram-bot:master Sep 7, 2025
28 of 29 checks passed
@aelkheir aelkheir removed the 📋 pending-review work status: pending-review label Sep 7, 2025
@github-actions github-actions bot locked and limited conversation to collaborators Sep 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

.delete() method doesn't work on business messages.

3 participants