当前位置: 首页>>代码示例>>Python>>正文


Python base.RauthTestCase类代码示例

本文整理汇总了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
开发者ID:Leftium,项目名称:rauth,代码行数:9,代码来源:test_service.py

示例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
开发者ID:sjl,项目名称:rauth,代码行数:11,代码来源:test_service.py

示例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
开发者ID:10to8,项目名称:rauth,代码行数:17,代码来源:test_service_ofly.py

示例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
开发者ID:maxcountryman,项目名称:rauth,代码行数:18,代码来源:test_service_oauth2.py

示例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
开发者ID:appsforartists,项目名称:rauth,代码行数:20,代码来源:test_service.py

示例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
开发者ID:maxcountryman,项目名称:rauth,代码行数:21,代码来源:test_service_oauth1.py

示例7: setUp

    def setUp(self):
        RauthTestCase.setUp(self)

        self.session = OAuth2Session('123', '345')
        self.session_no_creds = OAuth2Session()
开发者ID:maxcountryman,项目名称:rauth,代码行数:5,代码来源:test_session.py


注:本文中的base.RauthTestCase类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。