Commit graph

18 commits

Author SHA1 Message Date
b8d927df8e
Kill 2.6/2.7 2020-04-02 23:08:52 -07:00
Phil Gyford
5a008e7e77 Move all the raw tweets for tests into their own JSON files
Seems better to have the raw data as JSON, like it comes from the API,
then load it into python objects for each test.
2017-10-11 18:27:53 +01:00
Phil Gyford
5c55aa8844 Cut some un-needed data out of the test tweet objects 2017-10-10 12:41:00 +01:00
Phil Gyford
9ccdb48248 Add test for html_for_tweet() for retweets 2017-10-10 12:31:57 +01:00
Phil Gyford
9ade0946b5 Add test for html_for_tweet() for quoted tweets 2017-10-10 12:24:09 +01:00
Phil Gyford
13fd0a8684 Define encoding for tests config file 2017-10-10 11:57:03 +01:00
Phil Gyford
a27efd9da8 Fix html_for_tweet()s handling of media URLs
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.
2017-10-07 18:38:20 +01:00
Phil Gyford
0ee9b76b5c Make html_for_tweet() link a replied-to username
If a tweet was a reply, then when `html_for_tweet()` tried to turn
the initial "@username" into a link, there was:

    > NameError: name 'sub_expr' is not defined

This is now fixed, with a test to ensure the "@username" becomes
a link.
2017-10-03 19:12:02 +01:00
Phil Gyford
b366ab55c3 Improve replacing of entities with links in html_for_tweet()
I've re-written the parts of `html_for_tweet()` so that it handles
all the replacements of URLs, mentions, symbols and hashtags better.

Mainly to fix #447 but it should be a little more robust generally.

Shamelessly cribbed from https://stackoverflow.com/a/25514650/250962

Passes all tests, but I haven't checked it beyond that.

Fixes #447
2017-08-22 13:49:40 +01:00
ping
c57c4bfc34 Update html_for_tweet to support extended tweets 2016-09-20 17:18:21 +08:00
Phil Gyford
a1640f4a17 Link $IBM-style symbols in tweets in html_for_tweet()
Fixes #412
2016-04-22 14:22:32 +01:00
ping
3cd88a09e6 Format media entities in Twython.html_for_tweet() 2014-12-02 17:54:52 +08:00
Joe Cabrera
a0fec2f004 pep8 finished 2014-07-26 11:48:36 -04:00
cash
30ff4319e2 updated unit tests and travis config for python 2.6 and 3 2014-01-11 19:45:46 -05:00
Mike Helmick
0fef3369ae Attempting to fix tests again -___- 2013-07-18 21:16:08 -04:00
Mike Helmick
3c637ddc7d Tests and documentation 2013-06-27 19:20:43 -04:00
Mike Helmick
478c139af2 Coverage, tests, secure ACCESS_TOKEN, update HISTORY 2013-06-11 17:12:34 -04:00
Mike Helmick
6ce39f9921 Moving tests to their own folder 2013-06-11 14:41:46 -04:00