def METHOD_NAME(self):
    with self.assertRaises(Exception):
        bitbucket.oauth.get_json_value(None, 'name')
    auth = self.server.auth()
    response = utils.Response({"name": "value"})
    with self.assertRaises(oauth_api.OAuthException):
        auth.get_json_value(response, 'foo')
    val = auth.get_json_value(response, 'name')
    self.assertEqual(val, 'value')