Exemple #1
0
 def auth_app(self, port=8080, resource=None, html=None):
     """ Start the oAuth client.
         
         Provide custom HTML in the ``html`` parameter to provide a custom
         response page to be given in return to web requests.
     """
     client = oAuthClient(self._reactor, port, resource, html)
     # Start serving requests.
     d = client.serve()
     # Defer the handling or whatever.
     d.addCallback(self._authResponse)
     return d
Exemple #2
0
 def auth_app(self, port=8080, resource=None, html=None):
     """ Start the oAuth client.
         
         Provide custom HTML in the ``html`` parameter to provide a custom
         response page to be given in return to web requests.
     """
     client = oAuthClient(self._reactor, port, resource, html)
     # Start serving requests.
     d = client.serve()
     # Defer the handling or whatever.
     d.addCallback(self._authResponse)
     return d
    def test_handle_request(self):
        """ Test what happens when a request is sent to the server. """

        def onSuccess(request):
            pass

        def onFailure(err):
            pass

        self.server = oAuthClient(reactor)
        self.d = self.server.serve()
        self.d.addCallbacks(onSuccess, onFailure)

        # Web request
        self.server.deferred(None, {})

        return self.d
    def test_handle_request(self):
        """ Test what happens when a request is sent to the server. """
        
        def onSuccess(request):
            pass
        
        def onFailure(err):
            pass
        
        self.server = oAuthClient(reactor)
        self.d = self.server.serve()
        self.d.addCallbacks(onSuccess, onFailure)
        
        # Web request
        self.server.gotResponse({})
        
        # There's really no need to return a callback here. ``gotResponse``
        # invokes our callback without waiting. So yeah... Just to be safe,
        # though.
        
        return self.d


# EOF