Beispiel #1
0
    def test_adapter_config(self):
        from sanction.config import adapter_config

        c = adapter_config("google", get_config())

        self.assertIsNotNone(c["client_id"])
        self.assertIsNotNone(c["client_secret"])
        self.assertIsNotNone(c["redirect_uri"])
        self.assertIsNotNone(c["scope"])
        self.assertEquals(c["http_debug"], True)
Beispiel #2
0
    def __init__(self, config, flow=None, service=None):

        if flow is None:
            flow = AuthorizationRequestFlow
        else:
            assert(issubclass(flow, ResourceFlow))

        if service is None:
            service = HTTPSService
        else:
            assert(issubclass(service, BaseService))

        self.__name = self.__class__.__name__.lower()
        self.__credentials = None
        self.__config = adapter_config(self.__name, config)
        self.__service = service()
        self.__flow = flow(self)