"""Fixture Api. Provides a set of handy methods that helps to write unit tests. Author: Michael Ortali Date: 09/22/2014 """ from analytics import api from analytics import config from analytics import handlers # noqa route = api.route APP = api.app CLIENT = APP.test_client() def get(url): """Proxy to the get method of the client. Proxy to the get method of client and add the X-Orchard-API-Key header to behave as an internal api call. Args: url (string): the api endpoint url. Returns: Response: The api response object. """ return CLIENT.get(url, headers=[ ('X-Orchard-API-Key', config.API_KEY_INTERNAL)])