def test_getTakerFeeWithMarket(): filename = 'config.json' with open(filename) as config_file: config = json.load(config_file) api_key = '' api_secret = '' api_url = '' if 'api_key' in config and 'api_secret' in config and 'api_pass' in config and 'api_url' in config: api_key = config['api_key'] api_secret = config['api_secret'] api_url = config['api_url'] AuthAPI(api_key, api_secret, api_url) elif 'api_key' in config['binance'] and 'api_secret' in config[ 'binance'] and 'api_url' in config['binance']: api_key = config['binance']['api_key'] api_secret = config['binance']['api_secret'] api_url = config['binance']['api_url'] AuthAPI(api_key, api_secret, api_url) exchange = AuthAPI(api_key, api_secret, api_url) assert type(exchange) is AuthAPI fee = exchange.getTakerFee(VALID_ORDER_MARKET) assert type(fee) is float assert fee > 0
def test_getTakerFeeWithoutMarket(): filename = 'config.json' with open(filename) as config_file: config = json.load(config_file) api_key = '' api_secret = '' api_url = '' if 'api_key' in config and 'api_secret' in config and 'api_pass' in config and 'api_url' in config: api_key = config['api_key'] api_secret = config['api_secret'] api_url = config['api_url'] AuthAPI(api_key, api_secret, api_url) elif 'api_key' in config['binance'] and 'api_secret' in config[ 'binance'] and 'api_url' in config['binance']: api_key = config['binance']['api_key'] api_secret = config['binance']['api_secret'] api_url = config['binance']['api_url'] AuthAPI(api_key, api_secret, api_url) exchange = AuthAPI(api_key, api_secret, api_url) assert type(exchange) is AuthAPI fees = exchange.getTakerFee() assert type(fees) is pandas.core.frame.DataFrame assert len(fees) > 0