requests_mock.exceptions.InvalidRequest

Here are the examples of the python api requests_mock.exceptions.InvalidRequest taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

Example 1

Project: fjord Source File: response.py
Function: send
    def send(self, request, **kwargs):
        msg = 'This response was created without a connection. You are ' \
              'therefore unable to make a request directly on that connection.'
        raise exceptions.InvalidRequest(msg)

Example 2

Project: fjord Source File: test_response.py
    def test_send_from_no_connection(self):
        resp = self.create_response()
        self.assertRaises(exceptions.InvalidRequest,
                          resp.connection.send, self.request)