Ejemplo n.º 1
0
 def test_kwargs_with_dict_as_rule(self):
     specific_collections = build_specific_collections(has={
         'fetchOrderBook': True,
         'createOrder': True
     })
     # exchanges which are confirmed to meet the given criteria (.hasFetchOrderBook and .hasCreateOrder)
     confirmed_exchanges = []
     for exchange_list in specific_collections.values():
         for exchange_name in exchange_list:
             if exchange_name in confirmed_exchanges:
                 continue
             exchange = getattr(ccxt, exchange_name)()
             self.assertTrue(exchange.hasFetchOrderBook
                             and exchange.hasCreateOrder)
             confirmed_exchanges.append(exchange_name)
Ejemplo n.º 2
0
 def test_errors_raised(self):
     with self.assertRaises(ValueError):
         # note the misspelling of "countries" as "contries"
         build_specific_collections(contries=['US'])
Ejemplo n.º 3
0
# This code is modified from examples/test_build_collections.py
from peregrinearb.async_build_markets import build_specific_collections

# This is a dict of the collections only containing exchanges which have the fetch_order_book, create_market_buy_order,
# create_market_sell_order, create_limit_buy_order, and create_limit_sell_order functions.
specific_collections = build_specific_collections(has={
    'fetchOrderBook': True,
    'createOrder': True
})