X Tutup
Skip to content

fixes broken test cases with PhotoSize, Game and Animation classes#435

Merged
jh0ker merged 3 commits intopython-telegram-bot:october3from
PH89:october3
Oct 10, 2016
Merged

fixes broken test cases with PhotoSize, Game and Animation classes#435
jh0ker merged 3 commits intopython-telegram-bot:october3from
PH89:october3

Conversation

@PH89
Copy link
Copy Markdown
Contributor

@PH89 PH89 commented Oct 9, 2016

However testSendGame and test_set_game_score both produce:

BadRequest: u'Wrong file identifier/HTTP URL specified

for the official @pythontelegrambottests test bot.

This is very probably the case because the test bot it not correctly configured to be a game.

PH89 added 2 commits October 9, 2016 18:30
However:
testSendGame and test_set_game_score both produces *BadRequest: u'Wrong file identifier/HTTP URL specified'*.
@jsmnbom
Copy link
Copy Markdown
Member

jsmnbom commented Oct 9, 2016

The @pythontelegrambottests is indeed not set up with games properly since I just tested locally with my own one. However, I'm hereby pinging @leandrotoledo about it.

Copy link
Copy Markdown
Member

@jh0ker jh0ker left a comment

Choose a reason for hiding this comment

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

I left only one comment and I would love to hear your ideas on it. Cheers!

telegram/base.py Outdated
if value is not None:
if hasattr(value, 'to_dict'):
data[key] = value.to_dict()
if type(value) == list:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

If I understand this part correctly, you added this to decode attributes that are marked as "Array of ..." in the API docs?

In case I assume correctly, we usually have a de_list method on classes like PhotoSize (Implementation and usage examples) when needed.

However, I do like your solution for this. Maybe it could be implemented in a separate PR, for all cases where it is needed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Update from a private chat: I was wrongfully thinking of de_json instead of to_dict, but the outcome is the same.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@jh0ker Thank you for feedback. 👍 In ce62ef8 introduced a suitable to_dict method in the Game class for make this type check unnecessary.

@jh0ker
Copy link
Copy Markdown
Member

jh0ker commented Oct 9, 2016

@PH89 I'd like to get in touch with you via Telegram. If you're okay with that, please shoot me a message at @jh0ker

@jh0ker
Copy link
Copy Markdown
Member

jh0ker commented Oct 10, 2016

Awesome! LGTM, merging

@jh0ker jh0ker merged commit 8dc10fc into python-telegram-bot:october3 Oct 10, 2016
@github-actions github-actions bot locked and limited conversation to collaborators Aug 24, 2020
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.

3 participants

X Tutup