def test_raise_oauth_exception(self): oerrormessage = "fakemessage" oerrorurl = "http://oauth.reddit.com/" def raise_oauth_exception(): raise errors.OAuthException(oerrormessage, oerrorurl) self.assertRaises(errors.OAuthException, raise_oauth_exception) oauth_exception = errors.OAuthException(oerrormessage, oerrorurl) self.assertEqual( oauth_exception.message + " on url {0}".format(oauth_exception.url), str(oauth_exception))
def raise_oauth_exception(): raise errors.OAuthException(oerrormessage, oerrorurl)