Exemple #1
0
    def setUp(self):
        RauthTestCase.setUp(self)

        # mock service for testing
        service = OflyService('example',
                              consumer_key='123',
                              consumer_secret='456',
                              authorize_url='http://example.com/authorize')
        self.service = service
Exemple #2
0
    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
Exemple #3
0
    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
Exemple #4
0
    def setUp(self):
        RauthTestCase.setUp(self)

        # mock service for testing
        service = OAuth1Service(
                'example',
                consumer_key='123',
                consumer_secret='456',
                request_token_url='http://example.com/request_token',
                access_token_url='http://example.com/access_token',
                authorize_url='http://example.com/authorize')
        self.service = service

        # mock response content
        self.response.content = 'oauth_token=123&oauth_token_secret=456'
Exemple #5
0
    def setUp(self):
        RauthTestCase.setUp(self)

        # mock service for testing
        service = OAuth1Service(
            'example',
            consumer_key='123',
            consumer_secret='456',
            request_token_url='http://example.com/request_token',
            access_token_url='http://example.com/access_token',
            authorize_url='http://example.com/authorize')
        self.service = service

        # mock response content
        self.response.content = 'oauth_token=123&oauth_token_secret=456'
Exemple #6
0
    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
    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
Exemple #8
0
    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
    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
Exemple #10
0
    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
Exemple #11
0
    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
    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
Exemple #13
0
    def setUp(self):
        RauthTestCase.setUp(self)

        self.session = OAuth2Session('123', '345')
        self.session_no_creds = OAuth2Session()
Exemple #14
0
    def setUp(self):
        RauthTestCase.setUp(self)

        self.session = OAuth1Session('123', '345')