def get_headers(self): headers = BaseRest.get_headers(self) headers['X-Access-Token'] = self.config.get('token') headers['X-Client-ID'] = self.config.get('client_id') return headers
def test_go_failed(self, requests): requests.get.return_value = DummyResponse('', 404) rest = Spell({ 'endpoint': self.ENDPOINT }) results = rest.go() for item in results: assert not item requests.get.assert_called_once_with(self.ENDPOINT, headers=rest.get_headers())