Ejemplo n.º 1
0
    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
Ejemplo n.º 2
0
    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())