As described in the Twitter API docs, the `verify_credentials`
method accepts the optional `include_entities` and `skip_status`
parameters.
https://dev.twitter.com/docs/api/1/get/account/verify_credentials
I've modified `tweepy.API.verify_credentials` for allowing these
parameters and expanded `tests.testverifycredentials` to test the
new functionality
def testverifycredentials(self):
self.assertNotEqual(self.api.verify_credentials(), False)
+ # make sure that `me.status.entities` is not an empty dict
+ me = self.api.verify_credentials(include_entities=True)
+ self.assertTrue(me.status.entities)
+
+ # `status` shouldn't be included
+ me = self.api.verify_credentials(skip_status=True)
+ self.assertFalse(hasattr(me, 'status'))
+
api = API(BasicAuthHandler('bad', 'password'))
self.assertEqual(api.verify_credentials(), False)
)
""" account/verify_credentials """
- def verify_credentials(self):
+ def verify_credentials(self, **kargs):
try:
return bind_api(
path = '/account/verify_credentials.json',
payload_type = 'user',
- require_auth = True
- )(self)
+ require_auth = True,
+ allowed_param = ['include_entities', 'skip_status'],
+ )(self, **kargs)
except TweepError, e:
if e.response and e.response.status == 401:
return False