def __init__(self, config): self.config = config logger.debug("Creating API instance") api_config = pybrawl.Configuration() api_config.api_key['authorization'] = config['api']['api_key'] api_config.access_token = config['api']['api_key'] # TODO document why this addition is needed! #print(api_config.api_key) if config['api']['proxy']: api_config.proxy = config['api']['proxy'] if config['api']['proxy_headers']: api_config.proxy_headers = config['api']['proxy_headers'] self.clubs = pybrawl.ClubsApi(pybrawl.ApiClient(api_config)) self.players = pybrawl.PlayersApi(pybrawl.ApiClient(api_config))
def test_configuration(self): self.api = pybrawl.PlayersApi( pybrawl.ApiClient(config.getConfiguration()))
def setUp(self): # create an instance of the API class self.api = pybrawl.PlayersApi( pybrawl.ApiClient(config.getConfiguration())) pass