def test_cancel_by_id(self): try: mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0) order = self.e.bid(mk, rate=100, quantity=1) # print(vars(order)) cancelled = self.e.cancel(order_id=order.order_id) self.assertTrue(isinstance(cancelled, list)) self.assertTrue(isinstance(cancelled[0], Order)) # print(cancelled) finally: self.e.cancel(all=True)
def test_cancel_by_id(self): try: mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0) order = self.e.bid(mk, rate=.0001, quantity=.001) # print(order) cancelled = self.e.cancel(order_id=order.order_id) self.assertTrue(isinstance(cancelled, list)) self.assertTrue(isinstance(cancelled[0], Order)) # print(cancelled) finally: self.e.cancel(all=True)
def test_candles(self): mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0) candles = self.e.candles(mk) # print(candles) self.assertTrue(isinstance(candles, list)) self.assertTrue(isinstance(candles[0], Candle))
def test_ticker(self): mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0) ticker = self.e.ticker(mk) self.assertTrue(isinstance(ticker, Ticker))
def test_balance(self): mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0) orderbook = self.e.order_book(mk) # print(vars(orderbook.asks[0])) self.assertTrue(isinstance(orderbook, OrderBook))
def test_orders(self): mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0) self.e.bid(mk, rate=.0001, quantity=.001) orders = self.e.orders(mk) self.assertTrue(isinstance(orders, list)) self.assertTrue(isinstance(orders[0], Order))
def test_cancel_all(self): mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0) self.e.bid(mk, rate=.0001, quantity=.001) cancelled = self.e.cancel(all=True) self.assertTrue(isinstance(cancelled[0], Order))
def test_cancel_by_market(self): mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0) self.e.bid(mk, rate=.0001, quantity=.001) cancelled = self.e.cancel(market=mk) self.assertTrue(isinstance(cancelled, list)) self.assertTrue(isinstance(cancelled[0], Order))
def test_ask(self): mk = Market('ETC', 'BTC', 'ETCBTC', .001, 0, 0) order = self.e.ask(mk, rate=100, quantity=.001) # print(vars(order)) self.assertTrue(isinstance(order, Order)) self.e._orders_cancel('ETCBTC')
def test_orders(self): mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0) self.e.bid(mk, rate=100, quantity=1) orders = self.e.orders() self.assertTrue(isinstance(orders, list)) self.assertTrue(isinstance(orders[0], Order))
def test_cancel_all(self): mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0) self.e.bid(mk, rate=100, quantity=1) cancelled = self.e.cancel(all=True) self.assertTrue(isinstance(cancelled[0], Order))
def test_cancel_by_market(self): mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0) self.e.bid(mk, rate=100, quantity=1) cancelled = self.e.cancel(market=mk) self.assertTrue(isinstance(cancelled, list)) self.assertTrue(isinstance(cancelled[0], Order))
def test_ask(self): mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0) order = self.e.ask(mk, rate=1000000, quantity=1) # print(vars(order)) self.assertTrue(isinstance(order, Order)) self.e._cancel_all()
def test_position(self): mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0) position = self.e.position(mk) # print(position) self.assertTrue(isinstance(position, int))
def test_ticker(self): mk = Market('USD', 'BTC', 'XBTUSD', 1, 0, 0) ticker = self.e.ticker(mk) self.assertTrue(isinstance(ticker, Ticker))