99
1010import twitter
1111
12- warnings .filterwarnings ('ignore' , category = DeprecationWarning )
13-
1412import responses
1513from responses import GET , POST
1614
15+ warnings .filterwarnings ('ignore' , category = DeprecationWarning )
16+
17+
1718DEFAULT_URL = re .compile (r'https?://.*\.twitter.com/1\.1/.*' )
1819
1920
@@ -205,7 +206,6 @@ def testGetTrendsCurrent(self):
205206 # lambda: self.api.GetHomeTimeline(
206207 # since_id='still infinity'))
207208
208-
209209 # # TODO: Get data for this call against which we can test exclusions.
210210 # responses.add(
211211 # responses.GET,
@@ -461,29 +461,29 @@ def testGetFriendsAdditionalParams(self):
461461 # @responses.activate
462462 # def testGetFriends(self):
463463
464- # """
465- # This is tedious, but the point is to add a responses endpoint for
466- # each call that GetFriends() is going to make against the API and
467- # have it return the appropriate json data.
468- # """
464+ # """
465+ # This is tedious, but the point is to add a responses endpoint for
466+ # each call that GetFriends() is going to make against the API and
467+ # have it return the appropriate json data.
468+ # """
469469
470- # cursor = -1
471- # for i in range(0, 5):
472- # with open('testdata/get_friends_{0}.json'.format(i)) as f:
473- # resp_data = f.read()
474- # endpoint = '/friends/list.json?screen_name=codebear&count=200&skip_status=False&include_user_entities=True&cursor={0}'.format(cursor)
470+ # cursor = -1
471+ # for i in range(0, 5):
472+ # with open('testdata/get_friends_{0}.json'.format(i)) as f:
473+ # resp_data = f.read()
474+ # endpoint = '/friends/list.json?screen_name=codebear&count=200&skip_status=False&include_user_entities=True&cursor={0}'.format(cursor)
475475
476- # responses.add(
477- # responses.GET,
478- # '{base_url}{endpoint}'.format(
479- # base_url=self.api.base_url,
480- # endpoint=endpoint),
481- # body=resp_data, match_querystring=True, status=200)
476+ # responses.add(
477+ # responses.GET,
478+ # '{base_url}{endpoint}'.format(
479+ # base_url=self.api.base_url,
480+ # endpoint=endpoint),
481+ # body=resp_data, match_querystring=True, status=200)
482482
483- # cursor = json.loads(resp_data)['next_cursor']
483+ # cursor = json.loads(resp_data)['next_cursor']
484484
485- # resp = self.api.GetFriends(screen_name='codebear')
486- # self.assertEqual(len(resp), 819)
485+ # resp = self.api.GetFriends(screen_name='codebear')
486+ # self.assertEqual(len(resp), 819)
487487
488488 @responses .activate
489489 def testGetFriendsWithLimit (self ):
@@ -1353,7 +1353,6 @@ def testGetStatusWithExtAltText(self):
13531353 resp = self .api .GetStatus (status_id = 724441953534877696 )
13541354 self .assertEqual (resp .media [0 ].ext_alt_text , "\u201c Jon Snow is dead.\u2026 \u201d from \u201c GAME OF THRONES SEASON 6 EPISODES\u201d by HBO PR." )
13551355
1356-
13571356 @responses .activate
13581357 def testGetStatus (self ):
13591358 with open ('testdata/get_status.json' ) as f :
@@ -1380,7 +1379,6 @@ def testGetStatusExtraParams(self):
13801379 resp = self .api .GetStatus (status_id = 397 , trim_user = True , include_entities = False )
13811380 self .assertFalse (resp .user .screen_name )
13821381
1383-
13841382 # @responses.activate
13851383 # def testGetStatusOembed(self):
13861384 # with open('testdata/get_status_oembed.json') as f:
0 commit comments