コード例 #1
0
 def test_query_params_only(self):
     """Test with query param in redirect uri"""
     redirect_uri = self.redirect_uri + "path/?action=something"
     error = AuthorizeError(redirect_uri, self.error, self.grant_type)
     created_uri = error.create_uri(redirect_uri, '')
     expected_uri = '{}&error={}&error_description={}'.format(
         redirect_uri, self.error, self.desc)
     compare(expected_uri, created_uri)
コード例 #2
0
 def test_no_params(self):
     """Test with a path only and no query/frag params"""
     redirect_uri = self.redirect_uri + 'path'
     error = AuthorizeError(redirect_uri, self.error, self.grant_type)
     created_uri = error.create_uri(redirect_uri, '')
     expected_uri = '{}?error={}&error_description={}'.format(
         redirect_uri, self.error, self.desc)
     compare(expected_uri, created_uri)
コード例 #3
0
 def test_with_deep_link(self):
     """Test with a non-http schema; deep link style (think slack://)"""
     redirect_uri = 'slack://example.com/path'
     state = 'my_state'
     error = AuthorizeError(redirect_uri, self.error, self.grant_type)
     created_uri = error.create_uri(redirect_uri, state)
     expected_uri = '{}?error={}&error_description={}&state={}' \
         .format(redirect_uri, self.error, self.desc, state)
     compare(expected_uri, created_uri)
コード例 #4
0
 def test_with_state(self):
     """Test with state"""
     redirect_uri = self.redirect_uri + 'path'
     state = 'my_state'
     error = AuthorizeError(redirect_uri, self.error, self.grant_type)
     created_uri = error.create_uri(redirect_uri, state)
     expected_uri = '{}path?error={}&error_description={}&state={}' \
         .format(self.redirect_uri, self.error, self.desc, state)
     compare(expected_uri, created_uri)
コード例 #5
0
 def test_query_and_frag_params(self):
     """Test with both qp's and fragment"""
     redirect_uri = self.redirect_uri + 'path?my_qp=test'
     frag = '#action=something'
     error = AuthorizeError(redirect_uri + frag, self.error,
                            self.grant_type)
     created_uri = error.create_uri(redirect_uri + frag, '')
     expected_uri = '{}path?my_qp=test&error={}&error_description={}{}' \
         .format(self.redirect_uri, self.error, self.desc, frag)
     compare(expected_uri, created_uri)
コード例 #6
0
 def test_frag_params_only(self):
     """Test with fragment params only"""
     redirect_uri = self.redirect_uri + 'path'
     frag = '#action=something'
     error = AuthorizeError(redirect_uri + frag, self.error,
                            self.grant_type)
     created_uri = error.create_uri(redirect_uri + frag, '')
     expected_uri = '{}path?error={}&error_description={}{}'.format(
         self.redirect_uri, self.error, self.desc, frag)
     compare(expected_uri, created_uri)