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
0
Example 1
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)
0
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)