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
Fix URLs for multiple media in html_for_tweet() #461
Fix URLs for multiple media in html_for_tweet() #461
Conversation
We were trying to link to each media item using its `url`/`expanded_url`. But there is only one of these, shared across all of a tweet's media items. So attempting to put it in several times, in the same location, was a bit of a mess! So it now only puts the `url`/`expanded_url` in once, no matter how many media items there are.
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 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! |
I've:
|
BTW, 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. |
Seems better to have the raw data as JSON, like it comes from the API, then load it into python objects for each test.
Whoops... do you have any idea how I'd reference a file like |
Phew, got it :) I think that's me done for now. |
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