Skip to content

Commit 00a3b6a

Browse files
committed
adds tests for DestroyRetweet method
1 parent ae0e61a commit 00a3b6a

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"in_reply_to_user_id": null, "in_reply_to_status_id": null, "id_str": "735890565523509248", "retweeted": true, "truncated": false, "in_reply_to_status_id_str": null, "possibly_sensitive": false, "retweet_count": 1, "created_at": "Thu May 26 17:49:17 +0000 2016", "favorited": false, "in_reply_to_user_id_str": null, "in_reply_to_screen_name": null, "lang": "en", "entities": {"hashtags": [], "user_mentions": [], "symbols": [], "media": [{"indices": [35, 58], "media_url": "http://pbs.twimg.com/media/CjZokfqXAAAuszm.jpg", "expanded_url": "http://twitter.com/__jcbl__/status/735890565523509248/photo/1", "display_url": "pic.twitter.com/B1MxcMP3CY", "media_url_https": "https://pbs.twimg.com/media/CjZokfqXAAAuszm.jpg", "url": "https://t.co/B1MxcMP3CY", "sizes": {"medium": {"h": 1065, "resize": "fit", "w": 600}, "thumb": {"h": 150, "resize": "crop", "w": 150}, "large": {"h": 1085, "resize": "fit", "w": 611}, "small": {"h": 604, "resize": "fit", "w": 340}}, "id_str": "735890565305401344", "id": 735890565305401344, "type": "photo"}], "urls": []}, "extended_entities": {"media": [{"indices": [35, 58], "media_url": "http://pbs.twimg.com/media/CjZokfqXAAAuszm.jpg", "expanded_url": "http://twitter.com/__jcbl__/status/735890565523509248/photo/1", "display_url": "pic.twitter.com/B1MxcMP3CY", "media_url_https": "https://pbs.twimg.com/media/CjZokfqXAAAuszm.jpg", "url": "https://t.co/B1MxcMP3CY", "sizes": {"medium": {"h": 1065, "resize": "fit", "w": 600}, "thumb": {"h": 150, "resize": "crop", "w": 150}, "large": {"h": 1085, "resize": "fit", "w": 611}, "small": {"h": 604, "resize": "fit", "w": 340}}, "id_str": "735890565305401344", "id": 735890565305401344, "type": "photo"}]}, "id": 735890565523509248, "geo": null, "coordinates": null, "is_quote_status": false, "text": "love reading the news on my phone! https://t.co/B1MxcMP3CY", "place": null, "user": {"profile_background_image_url_https": "https://abs.twimg.com/images/themes/theme1/bg.png", "entities": {"description": {"urls": []}, "url": {"urls": [{"indices": [0, 22], "expanded_url": "http://iseverythingstilltheworst.com", "display_url": "iseverythingstilltheworst.com", "url": "http://t.co/wtg3XzqQTX"}]}}, "default_profile_image": false, "verified": false, "is_translation_enabled": false, "utc_offset": -14400, "description": "my kingdom for a microwave that doesn't beep", "id_str": "372018022", "profile_sidebar_border_color": "000000", "friends_count": 360, "profile_background_image_url": "http://abs.twimg.com/images/themes/theme1/bg.png", "following": true, "profile_use_background_image": false, "profile_image_url_https": "https://pbs.twimg.com/profile_images/719724025384083456/N98iQXqX_normal.jpg", "location": "not a very good kingdom tbh", "profile_background_tile": false, "created_at": "Sun Sep 11 23:49:28 +0000 2011", "followers_count": 66, "lang": "en", "screen_name": "__jcbl__", "name": "jeremy", "profile_background_color": "FFFFFF", "profile_sidebar_fill_color": "000000", "profile_image_url": "http://pbs.twimg.com/profile_images/719724025384083456/N98iQXqX_normal.jpg", "id": 372018022, "time_zone": "Eastern Time (US & Canada)", "profile_text_color": "000000", "is_translator": false, "listed_count": 6, "favourites_count": 2177, "protected": false, "statuses_count": 434, "contributors_enabled": false, "has_extended_profile": false, "follow_request_sent": false, "url": "http://t.co/wtg3XzqQTX", "profile_link_color": "EE3355", "notifications": false, "geo_enabled": false, "default_profile": false}, "favorite_count": 0, "source": "<a href=\"http://www.apple.com\" rel=\"nofollow\">iOS</a>", "contributors": null}

tests/test_api_30.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1713,3 +1713,14 @@ def test_UpdateBackgroundImage_deprecation(self):
17131713
with warnings.catch_warnings(record=True) as w:
17141714
resp = self.api.UpdateBackgroundImage(image='testdata/168NQ.jpg')
17151715
self.assertTrue(issubclass(w[0].category, DeprecationWarning))
1716+
1717+
@responses.activate
1718+
def testDestroyRetweet(self):
1719+
with open('testdata/post_statuses_unretweet_id.json') as f:
1720+
resp_data = f.read()
1721+
responses.add(responses.POST, DEFAULT_URL, body=resp_data, status=True)
1722+
resp = self.api.DestroyRetweet(status_id=735890565523509248)
1723+
1724+
self.assertTrue(isinstance(resp, twitter.Status))
1725+
self.assertEqual(resp.id, 735890565523509248)
1726+

0 commit comments

Comments
 (0)