Ejemplo n.º 1
0
    def test_get_access_token_unknown(self):
        inst = UserInfoProvider(self.store, {
            'Authorization': 'Unknown {token}'.format(
                token=self.token.get_token()
            ),
        })

        self.assertEqual(inst.get_access_token(), (None, ''))
Ejemplo n.º 2
0
 def test_handle_request(self):
     inst = UserInfoProvider(self.store, {
         'Authorization': 'Bearer {token}'.format(
             token=self.token.get_token()
         ),
     })
     resp = inst.handle_request(set(['openid']))
     self.assertEqual(resp, self.user_info.filter(set(['openid'])))
Ejemplo n.º 3
0
    def test_get_access_token(self):
        inst = UserInfoProvider(self.store, {
            'Authorization': 'Bearer {token}'.format(
                token=self.token.get_token()
            ),
        })

        self.assertEqual(
            inst.get_access_token(),
            (self.token.get_token(), 'bearer')
        )