Commit graph

41 commits

Author SHA1 Message Date
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
1511ee7b4d Split test_html_for_tweet() tests into their own file 2017-10-07 18:08:01 +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
Clayton A Davis
6166e86807 Add test for cursor creation 2017-09-11 13:52:43 -04:00
Phil Gyford
6890802b2a Add test for missing symbols in entities
If a tweet has no `symbols` in its `entities` then `html_for_tweet()`
was failing.

I'm not sure how common this is but, for example, tweets in a downloaded
archive do not have `symbols` for some reason.

The previous change (b366ab5) fixed this, but I'm adding a test
for this case.
2017-08-22 13:55:22 +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
Ben McGinnes
b5847e3e84 Added muting to test suite.
I should have checked for this earlier, ah well, 'tis here now.
Again, basically a copy of the blocking code updated for muting.

Excellent target to test it on too.
2014-11-02 14:15:37 +11:00
Mike Helmick
02d1a946c1 Unpin requests 2014-10-30 16:49:03 -04:00
Joe Cabrera
a0fec2f004 pep8 finished 2014-07-26 11:48:36 -04:00
Cory Benfield
f514816c6f Fixup python3 test failure. 2014-02-23 15:12:44 +00:00
Cory Benfield
673336ff8f Failing test for Accept-Encoding header 2014-02-23 15:07:01 +00:00
cash
fa2122127c Fixes #302 simplifies json decoding and handling of errors. Adds tests. 2014-01-25 16:56:48 -05:00
Cash Costello
c83304edf2 requests returns content as bytes so use bytes for test strings. Also changed api verison in test 1.1 to not confuse people 2014-01-14 11:14:14 -05:00
cash
9f7d38181e python 3.3 workaround for dropbox/responses issue 2014-01-11 19:45:47 -05:00
cash
30ff4319e2 updated unit tests and travis config for python 2.6 and 3 2014-01-11 19:45:46 -05:00
cash
c449e3f8e1 skipping tests that were failing because of external dependency on Twitter 2014-01-11 15:45:45 -05:00
cash
fc55791cbf updated remaining tests in test_core.py and removed cursor test (which will be replaced) 2014-01-11 15:37:47 -05:00
cash
5304803f09 added docstrings for new tests and finished testing input arguments of request() 2014-01-11 11:13:55 -05:00
cash
f075586fcd moved integration tests to new file 2014-01-11 10:06:30 -05:00
cash
9cbd3d6fbc added some basic tests of the core request() method using dropbox/responses 2014-01-09 22:59:23 -05:00
Mike Helmick
638f75b93d Fixes #266 2013-10-26 19:04:36 -04:00
Mike Helmick
06f5425724 Fixes #244 2013-07-20 17:46:13 -04:00
Mike Helmick
dd3727c6f5 Fixes #243 2013-07-20 17:22:07 -04:00
Mike Helmick
0fef3369ae Attempting to fix tests again -___- 2013-07-18 21:16:08 -04:00
Mike Helmick
a04a7c155c Fixing up some more tests
Even though this should be done in here really :P
2013-07-18 21:04:39 -04:00
Mike Helmick
a1ee2a93ad Attempting to fix some tests that started breaking... 2013-07-18 20:57:31 -04:00
Mike Helmick
2dc15b7030 Fix generator test, remove search_gen from coverage 2013-07-18 20:43:02 -04:00
Mike Helmick
acdf73a04e More tests, coverage, and excluding lines from being covered
There are some lines that will never be hit in tests, excluding those
from being covered!
2013-06-27 22:37:02 -04:00
Mike Helmick
3c637ddc7d Tests and documentation 2013-06-27 19:20:43 -04:00
Mike Helmick
7cab9d5dd1 Attempting to exclude lines that we can't necessarily hit in tests, added a test, fixed function name
update_profile_background_image has been in endpoints.py twice for a
bit, my bad.

Using update_profile_banner_image for the function name to update
profile banner image (that's what it was called previously)
2013-06-12 10:54:28 -04:00
Mike Helmick
478c139af2 Coverage, tests, secure ACCESS_TOKEN, update HISTORY 2013-06-11 17:12:34 -04:00
Mike Helmick
2f5f496ead More test coverage 2013-06-11 15:00:39 -04:00
Mike Helmick
6ce39f9921 Moving tests to their own folder 2013-06-11 14:41:46 -04:00