How to use the apiron.client function in apiron

To help you get started, we’ve selected a few apiron examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github ithaka / apiron / tests / test_client.py View on Github external
def test_call_when_raw_response_object_requested(self, mock_response, mock_endpoint):
        service = mock.Mock()
        service.get_hosts.return_value = ["http://host1.biz"]
        service.required_headers = {}

        session = mock.Mock()
        session.send.return_value = mock_response

        response = client.call(
            service, mock_endpoint, session=session, logger=mock.Mock(), return_raw_response_object=True
        )

        assert response is mock_response
github ithaka / apiron / src / apiron / endpoint / endpoint.py View on Github external
def __get__(self, instance, owner):
        caller = partial(client.call, owner, self)
        update_wrapper(caller, client.call)
        return caller
github ithaka / apiron / src / apiron / endpoint / endpoint.py View on Github external
def __get__(self, instance, owner):
        caller = partial(client.call, owner, self)
        update_wrapper(caller, client.call)
        return caller