def test_call_requests_post(self, requests_post): rm = RequestMaker(api_path='/', host='host', token='f4k3') requests_post.return_value = MockResponse(200, '') rm.post('/nowhere') self.assertTrue(requests_post.called)
def test_call_requests_delete_raise_exception_on_requests_error( self, requests_delete): rm = RequestMaker(api_path='/', host='host', token='f4k3') requests_delete.side_effect = requests.RequestException() self.assertRaises(taiga.exceptions.TaigaRestException, rm.delete, '/nowhere')