本文整理汇总了Python中base.RauthTestCase.setUp方法的典型用法代码示例。如果您正苦于以下问题:Python RauthTestCase.setUp方法的具体用法?Python RauthTestCase.setUp怎么用?Python RauthTestCase.setUp使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类base.RauthTestCase
的用法示例。
在下文中一共展示了RauthTestCase.setUp方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setUp
# 需要导入模块: from base import RauthTestCase [as 别名]
# 或者: from base.RauthTestCase import setUp [as 别名]
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
# 需要导入模块: from base import RauthTestCase [as 别名]
# 或者: from base.RauthTestCase import setUp [as 别名]
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
# 需要导入模块: from base import RauthTestCase [as 别名]
# 或者: from base.RauthTestCase import setUp [as 别名]
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
# 需要导入模块: from base import RauthTestCase [as 别名]
# 或者: from base.RauthTestCase import setUp [as 别名]
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
# 需要导入模块: from base import RauthTestCase [as 别名]
# 或者: from base.RauthTestCase import setUp [as 别名]
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
# 需要导入模块: from base import RauthTestCase [as 别名]
# 或者: from base.RauthTestCase import setUp [as 别名]
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
# 需要导入模块: from base import RauthTestCase [as 别名]
# 或者: from base.RauthTestCase import setUp [as 别名]
def setUp(self):
RauthTestCase.setUp(self)
self.session = OAuth2Session('123', '345')
self.session_no_creds = OAuth2Session()