Wrapper function for responses for simpler unit tests
(self, method, url, body='{}', match_querystring=False,
status=200, adding_headers=None, stream=False,
content_type='application/json; charset=utf-8')
| 27 | return '%s/%s.json' % (self.api.api_url % self.api.api_version, endpoint) |
| 28 | |
| 29 | def register_response(self, method, url, body='{}', match_querystring=False, |
| 30 | status=200, adding_headers=None, stream=False, |
| 31 | content_type='application/json; charset=utf-8'): |
| 32 | """Wrapper function for responses for simpler unit tests""" |
| 33 | |
| 34 | # responses uses BytesIO to hold the body so it needs to be in bytes |
| 35 | if not is_py2: |
| 36 | body = bytes(body, 'UTF-8') |
| 37 | |
| 38 | responses.add(method, url, body, match_querystring, |
| 39 | status, adding_headers, stream, content_type) |
| 40 | |
| 41 | @responses.activate |
| 42 | def test_request_should_handle_full_endpoint(self): |
no outgoing calls
no test coverage detected