本文整理汇总了Python中base.RauthTestCase类的典型用法代码示例。如果您正苦于以下问题:Python RauthTestCase类的具体用法?Python RauthTestCase怎么用?Python RauthTestCase使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RauthTestCase类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
def setUp(self):
RauthTestCase.setUp(self)
# mock service for testing
service = OflyService(name='example',
consumer_key='123',
consumer_secret='456',
authorize_url='http://example.com/authorize')
self.service = service
示例2: setUp
def setUp(self):
RauthTestCase.setUp(self)
# mock service for testing
service = OAuth2Service(
'example',
consumer_key='123',
consumer_secret='456',
access_token_url='http://example.com/access_token',
authorize_url='http://example.com/authorize')
self.service = service
示例3: setUp
def setUp(self):
RauthTestCase.setUp(self)
self.authorize_url = 'http://example.com/authorize'
self.base_url = 'http://example.com/api/'
self.service = OflyService(self.app_id,
self.app_secret,
name='service',
authorize_url=self.authorize_url,
base_url=self.base_url)
self.session = self.service.get_session(self.user_id)
# patch
self.session.request = self.fake_request
self.service.get_session = self.fake_get_session
示例4: setUp
def setUp(self):
RauthTestCase.setUp(self)
self.access_token_url = 'https://example.com/access'
self.authorize_url = 'https://example.com/authorize'
self.base_url = 'https://example/api/'
self.service = OAuth2Service(self.client_id,
self.client_secret,
access_token_url=self.access_token_url,
authorize_url=self.authorize_url,
base_url=self.base_url)
self.session = self.service.get_session(self.access_token)
# patches
self.session.request = self.fake_request
self.service.get_session = self.fake_get_session
示例5: setUp
def setUp(self):
RauthTestCase.setUp(self)
# Use JSON as the response type for OAuth2. RauthTestCase sets up
# for OAuth1.
self.response.content = \
'{"access_token": "321", "token_type": "Bearer"}'
self.response.headers = \
{'content-type': 'application/json;charset=ISO-8859-1'}
# mock service for testing
service = OAuth2Service(
name='example',
consumer_key='123',
consumer_secret='456',
access_token_url='http://example.com/access_token',
authorize_url='http://example.com/authorize',
base_url='http://example.com/api/',
access_token='987')
self.service = service
示例6: setUp
def setUp(self):
RauthTestCase.setUp(self)
self.request_token_url = 'http://example.com/request'
self.access_token_url = 'http://example.com/access'
self.authorize_url = 'http://example.com/authorize'
self.base_url = 'http://example.com/api/'
self.service = OAuth1Service(self.consumer_key,
self.consumer_secret,
name='service',
request_token_url=self.request_token_url,
access_token_url=self.access_token_url,
authorize_url=self.authorize_url,
base_url=self.base_url)
self.session = self.service.get_session(('123', '456'))
# patches
self.session.request = self.fake_request
self.service.get_session = self.fake_get_session
示例7: setUp
def setUp(self):
RauthTestCase.setUp(self)
self.session = OAuth2Session('123', '345')
self.session_no_creds = OAuth2Session()