Skip to content

Instantly share code, notes, and snippets.

@kerin
Created December 2, 2013 17:25
Show Gist options
  • Save kerin/7753074 to your computer and use it in GitHub Desktop.
Save kerin/7753074 to your computer and use it in GitHub Desktop.
@fudge.patch('twanel.tasks.pgm')
def test_task_retried_on_twitter_error(self, pgm):
err = fudge.Fake('error').is_a_stub()
err.fp.expects('read').returns('{}')
err.code = 500
exc = TwitterHTTPError(
err,
'friends/list',
"",
None
)
(pgm
.expects('get_all_panelists')
.with_args(after_twitter_id=None)
.raises(exc)
)
with self.assertRaises(TwitterHTTPError):
self.assertRaises(Retry, update_all_panelists_leaders)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment