pybites / challenges

PyBites Code Challenges
https://codechalleng.es/challenges/
693 stars 2.29k forks source link

fixing tweepy exception invalid pagnination method #669

Closed slipsnip closed 4 years ago

slipsnip commented 4 years ago

Tweep.error('Invalid Pagnation Mode') caused inside TestUserTweets after patching only tweepy.API.user_timeline when you try to use the new Cursor method:

cursor = tweepy.Cursor(api.user_timeline)

Where api is the authorized api returned from tweepy.API()

slipsnip commented 4 years ago

Here is some supporting documentation of the problem https://yadi.sk/d/MAwRqryS0ocBpA It is caused when you try to initialize a tweepy.Cursor object due to the unitest.mock.patch

bbelderbos commented 4 years ago

Thanks @slipsnip for catching that!