def test_get_all_accounts(self, node_param): if node_param == "non_appbase": bts = self.bts else: bts = self.appbase b = Blockchain(steem_instance=bts) accounts = [] for acc in b.get_all_accounts(steps=100, limit=100): accounts.append(acc) self.assertEqual(len(accounts), 100) limit = 5000 self.assertEqual(len(list(b.get_all_accounts(limit=limit))), limit) self.assertEqual(len(set(b.get_all_accounts(limit=limit))), limit)
def test_get_all_accounts(self): bts = self.bts b = Blockchain(steem_instance=bts) accounts = [] limit = 200 for acc in b.get_all_accounts(steps=100, limit=limit): accounts.append(acc) self.assertEqual(len(accounts), limit) self.assertEqual(len(set(accounts)), limit)
def test_get_all_accounts(self, node_param): if node_param == "normal": bts = self.bts else: bts = self.testnet b = Blockchain(steem_instance=bts) accounts = [] limit = 200 for acc in b.get_all_accounts(steps=100, limit=limit): accounts.append(acc) self.assertEqual(len(accounts), limit) self.assertEqual(len(set(accounts)), limit)
acc_dict[name] = acc if clear_acc_cache: acc.clear_cache() acc_dict = {} if clear_all_cache: clear_cache() if not shared_instance: del stm.rpc if __name__ == "__main__": stm = Steem() print("Shared instance: " + str(stm)) set_shared_steem_instance(stm) b = Blockchain() account_list = [] for a in b.get_all_accounts(limit=500): account_list.append(a) shared_instance = False clear_acc_cache = False clear_all_cache = False node = "https://api.steemit.com" n = 3 for i in range(1, n + 1): print("%d of %d" % (i, n)) profiling(node, account_list, shared_instance=shared_instance, clear_acc_cache=clear_acc_cache, clear_all_cache=clear_all_cache)