當前位置: 首頁>>代碼示例>>Python>>正文


Python RauthTestCase.setUp方法代碼示例

本文整理匯總了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
開發者ID:Leftium,項目名稱:rauth,代碼行數:11,代碼來源:test_service.py

示例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
開發者ID:sjl,項目名稱:rauth,代碼行數:13,代碼來源:test_service.py

示例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
開發者ID:10to8,項目名稱:rauth,代碼行數:19,代碼來源:test_service_ofly.py

示例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
開發者ID:maxcountryman,項目名稱:rauth,代碼行數:20,代碼來源:test_service_oauth2.py

示例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
開發者ID:appsforartists,項目名稱:rauth,代碼行數:22,代碼來源:test_service.py

示例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
開發者ID:maxcountryman,項目名稱:rauth,代碼行數:23,代碼來源:test_service_oauth1.py

示例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()
開發者ID:maxcountryman,項目名稱:rauth,代碼行數:7,代碼來源:test_session.py


注:本文中的base.RauthTestCase.setUp方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。