New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support 3.4 API #865

Merged
merged 15 commits into from Oct 14, 2017

Conversation

Projects
None yet
3 participants
@Eldinnie
Member

Eldinnie commented Oct 11, 2017

WIP
Live location stuff added See #864

@codecov

This comment has been minimized.

Show comment
Hide comment
@codecov

codecov bot Oct 11, 2017

Codecov Report

Merging #865 into master will decrease coverage by 0.13%.
The diff coverage is 88.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #865      +/-   ##
==========================================
- Coverage   91.89%   91.76%   -0.14%     
==========================================
  Files         101      101              
  Lines        3987     4055      +68     
  Branches      603      620      +17     
==========================================
+ Hits         3664     3721      +57     
- Misses        187      196       +9     
- Partials      136      138       +2
Flag Coverage Δ
#Appveyor 86.88% <88.73%> (+0.02%) ⬆️
#Travis 91.34% <85.91%> (-0.18%) ⬇️
Impacted Files Coverage Δ
telegram/inline/inputlocationmessagecontent.py 100% <100%> (ø) ⬆️
telegram/inline/inlinequeryresultlocation.py 100% <100%> (ø) ⬆️
telegram/message.py 96.22% <100%> (+0.21%) ⬆️
telegram/chat.py 100% <100%> (ø) ⬆️
telegram/bot.py 87.22% <84.31%> (-0.79%) ⬇️
telegram/ext/updater.py 76.66% <0%> (ø) ⬆️
telegram/utils/request.py 67.85% <0%> (+0.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 445bcde...f39b403. Read the comment docs.

codecov bot commented Oct 11, 2017

Codecov Report

Merging #865 into master will decrease coverage by 0.13%.
The diff coverage is 88.73%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #865      +/-   ##
==========================================
- Coverage   91.89%   91.76%   -0.14%     
==========================================
  Files         101      101              
  Lines        3987     4055      +68     
  Branches      603      620      +17     
==========================================
+ Hits         3664     3721      +57     
- Misses        187      196       +9     
- Partials      136      138       +2
Flag Coverage Δ
#Appveyor 86.88% <88.73%> (+0.02%) ⬆️
#Travis 91.34% <85.91%> (-0.18%) ⬇️
Impacted Files Coverage Δ
telegram/inline/inputlocationmessagecontent.py 100% <100%> (ø) ⬆️
telegram/inline/inlinequeryresultlocation.py 100% <100%> (ø) ⬆️
telegram/message.py 96.22% <100%> (+0.21%) ⬆️
telegram/chat.py 100% <100%> (ø) ⬆️
telegram/bot.py 87.22% <84.31%> (-0.79%) ⬇️
telegram/ext/updater.py 76.66% <0%> (ø) ⬆️
telegram/utils/request.py 67.85% <0%> (+0.89%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 445bcde...f39b403. Read the comment docs.

@python-telegram-bot python-telegram-bot deleted a comment from codecov bot Oct 11, 2017

@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Oct 11, 2017

Member

Ok I think I got everything in. Something weird going on with test_official. I don't really get the error. I'm hoping @bomjacob can find time to figure it out.

Also we need to let the bot set a stickerset on our group every test (going to be problematic I'm affraid) to properly test the set_chat_sticker_set and delete_chat_sticker_set methods.

Review wanted.

Member

Eldinnie commented Oct 11, 2017

Ok I think I got everything in. Something weird going on with test_official. I don't really get the error. I'm hoping @bomjacob can find time to figure it out.

Also we need to let the bot set a stickerset on our group every test (going to be problematic I'm affraid) to properly test the set_chat_sticker_set and delete_chat_sticker_set methods.

Review wanted.

Eldinnie added some commits Oct 11, 2017

@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Oct 11, 2017

Member

I found the problem with test_official.
It seems TG has their table messed up on:
https://core.telegram.org/bots/api#inputlocationmessagecontent
and
https://core.telegram.org/bots/api#inlinequeryresultlocation

Member

Eldinnie commented Oct 11, 2017

I found the problem with test_official.
It seems TG has their table messed up on:
https://core.telegram.org/bots/api#inputlocationmessagecontent
and
https://core.telegram.org/bots/api#inlinequeryresultlocation

@tsnoam

LGTM
Just one thing - because of the issue with the test_official, we must fix or skip the test (I wouldn't count on them to fix their documentation). Otherwise, our tests will keep failing.

@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Oct 11, 2017

Member

Note from @jh0ker Very nice, although perhaps it would be good to mention in the docstring that you can pass either location or lat/lon to edit_message_live_location

Member

Eldinnie commented Oct 11, 2017

Note from @jh0ker Very nice, although perhaps it would be good to mention in the docstring that you can pass either location or lat/lon to edit_message_live_location

@Eldinnie Eldinnie changed the title from started work on 3.4 API to support 3.4 API Oct 11, 2017

@tsnoam

tsnoam requested changes Oct 11, 2017 edited

All changes looks good.
However, the thing with a 2nd CR is that you see the things you haven't seen the first time.
I think that location should be mutually exclusive to (longitude, latitude). You can do something like to make sure that one and only one of the two is supplied:

if not (None not in (longitude, latitude)) ^ bool(location):
    raise Exception...
@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Oct 11, 2017

Member

Need to up tests aswell. Hopefully have time tomorrow

Member

Eldinnie commented Oct 11, 2017

Need to up tests aswell. Hopefully have time tomorrow

@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Oct 12, 2017

Member

@tsnoam added the requested check (and tests). If we can live with a small decrease in coverage due to not testing the groupstickerset stuff I think it's ready to merge/release

Member

Eldinnie commented Oct 12, 2017

@tsnoam added the requested check (and tests). If we can live with a small decrease in coverage due to not testing the groupstickerset stuff I think it's ready to merge/release

@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie

Eldinnie Oct 12, 2017

Member

@tsnoam
if not (latitude is not None or longitude is not None) ^ bool(location):
Ugly, but works.
If location and either lat or lon is not None it will raise.

Member

Eldinnie commented Oct 12, 2017

@tsnoam
if not (latitude is not None or longitude is not None) ^ bool(location):
Ugly, but works.
If location and either lat or lon is not None it will raise.

@tsnoam

This comment has been minimized.

Show comment
Hide comment
@tsnoam

tsnoam Oct 12, 2017

Member

@Eldinnie As discussed, please add () around the entire logical expression which start just after if not.

Member

tsnoam commented Oct 12, 2017

@Eldinnie As discussed, please add () around the entire logical expression which start just after if not.

@Eldinnie

This comment has been minimized.

Show comment
Hide comment
@Eldinnie
Member

Eldinnie commented Oct 12, 2017

@tsnoam Done

@tsnoam

tsnoam approved these changes Oct 12, 2017

LGTM
This passes Travis/appveyor and we can merge.

@jsmnbom

LGTM, tiny nitpick below, but it's so small we probably could just merge ^^

Show outdated Hide outdated telegram/chat.py
Show outdated Hide outdated telegram/chat.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment