예제 #1
0
    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))
예제 #2
0
 def raise_oauth_exception():
     raise errors.OAuthException(oerrormessage, oerrorurl)