def load_markets(self, reload=False) -> SymbolList: if reload or not self.markets: self.markets = self.get_markets() self.markets_by_id = Utils.index_by(self.markets, "id") self.markets_by_name = Utils.index_by(self.markets, "symbol") self.currencies = self.get_currencies() self.currencies_by_id = Utils.index_by(self.currencies, "id") self.currencies_by_name = Utils.index_by(self.currencies, "name") return self.markets
def test_index_by(self): symbols = self.client.load_markets() symbols_by_id = Utils.index_by(symbols, "id") self.assertTrue('336' in symbols_by_id)