Exemplo n.º 1
0
 def test_provider_config(self):
     c = Consumer(None, None)
     response = ASConfigurationResponse(
         **{
             'issuer': 'https://example.com',
             'end_session_endpoint': 'https://example.com/end_session'
         })
     with responses.RequestsMock() as rsps:
         rsps.add(responses.GET,
                  'https://example.com/.well-known/openid-configuration',
                  json=response.to_dict())
         info = c.provider_config('https://example.com')
     assert isinstance(info, ASConfigurationResponse)
     assert _eq(info.keys(), ['issuer', 'version', 'end_session_endpoint'])
     assert info[
         "end_session_endpoint"] == "https://example.com/end_session"
Exemplo n.º 2
0
 def test_provider_config(self):
     c = Consumer(None, None)
     response = ASConfigurationResponse(
         **{
             "issuer": "https://example.com",
             "end_session_endpoint": "https://example.com/end_session",
         })
     with responses.RequestsMock() as rsps:
         rsps.add(
             responses.GET,
             "https://example.com/.well-known/openid-configuration",
             json=response.to_dict(),
         )
         info = c.provider_config("https://example.com")
     assert isinstance(info, ASConfigurationResponse)
     assert _eq(info.keys(), ["issuer", "version", "end_session_endpoint"])
     assert info[
         "end_session_endpoint"] == "https://example.com/end_session"