Fix of Bot.copy_message#2651
Fix of Bot.copy_message#2651Bibo-Joshi merged 4 commits intopython-telegram-bot:masterfrom DonalDuck004:patch-1
Conversation
When you pass "" as a caption to this method, the caption is not sent to the Telegram API, because the if on line 5299 does not allow it to insert it in the dict of data to be sent to the Telegram API
|
Hm. How does this result in unwanted behavior? Can you delete an existing caption this way? |
Yes, this change allows you to remove the caption |
|
Ah. Great catch. Can you write a test verifying that it works now? |
|
Yes, now I try |
|
Oh no. Thats fine, I believed you that your change was working in the first place :D I asked for a unitest, can you do that? We have them in the |
|
Sorry, can you explain better? 😅 |
|
What pool means is that we have automated unit tests, which life in the |
|
Ok, thanks for the help |
Is this correct? https://pastebin.com/Af9fPsfH Result: tests/test_bot.py::TestBot::test_copy_message[Test-True] PASSED [ 16%] ================================================== 6 passed in 2.22s ================================================== |
Bibo-Joshi
left a comment
There was a problem hiding this comment.
looks good except for the failing pre-commit test :) I you like to, we could add another test in the style of test_copy_message_without_reply, which actually checks the result on the copied message instad of just checking that we pass the correct parameters to TG, but IMO that's optional.
|
Thanks for the contribution! |
When you pass "" as a caption to this method, the caption is not sent to the Telegram API, because the if on line 5299 does not allow it to insert it in the dict of data to be sent to the Telegram API