Fix URLs for multiple media in html_for_tweet() #461
No reviewers
Labels
No labels
Bug
Enhancement
Feature Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: code/twython#461
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "fix-media-in-html-for-tweet"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
I moved the
html_for_tweet()tests into their own file.Then fixed an issue with
html_for_tweet()displaying media links when there are multiple media items.As an example, one tweet that had multiple images was having its URL(s) come out something like:
rather than
Coverage decreased (-0.7%) to 56.498% when pulling
a27efd9da8on philgyford:fix-media-in-html-for-tweet into12e6b34d1don ryanmcgrath:master.Hmm, damn, not sure what I've done to reduce coverage. I can't work it out from coveralls.
@philgyford looks like api.py increased by 4 lines.
Yours: https://coveralls.io/builds/13616507/source?filename=twython%2Fapi.py
Master: https://coveralls.io/builds/13633835/source?filename=twython%2Fapi.py
You can see lines that are hit and aren't. It shouldn't be too big of a change though. Looks like nothing actually is missed.
It looks like Python 2.x fails on Travis https://travis-ci.org/ryanmcgrath/twython/builds/284748942?utm_source=github_status&utm_medium=notification
Whoops, I'll fix it later today/tomorrow. Getting so used to python 3 these days I forget about 2!
Coverage increased (+0.4%) to 57.568% when pulling
5c55aa8844on philgyford:fix-media-in-html-for-tweet into12e6b34d1don ryanmcgrath:master.I've:
html_for_tweet()tests to help bump the coverage back up a bitBTW, I was thinking it would make things a bit easier to follow if the test tweets were nicely-formatted JSON, that was loaded in to use in tests, rather than already being compact python dicts. I was just wary of messing around with things too much. Sound a good idea?
@philgyford I think a python file with dicts (that are formatted nicely) or a JSON file would be nice. Either or would achieve the "same" knowledge to edit.
config.pylooks like it just has a bunch of one line dicts :(Whoops... do you have any idea how I'd reference a file like
tests/tweets/basic.jsonfrom within a test, in a way that Travis etc will find it? That's worked for me before, but not this time!Coverage increased (+0.4%) to 57.568% when pulling
d3f5361f4don philgyford:fix-media-in-html-for-tweet into12e6b34d1don ryanmcgrath:master.Phew, got it :) I think that's me done for now.