예제 #1
0
파일: testcbase.py 프로젝트: laisee/hokonui
 def test_orders(cls):
     ''' method for testing orders'''
     orders = cba.get_current_orders(base.CCY_DEFAULT)
     ok_(len(orders["asks"]) > 0, "Asks array should not be empty")
     ok_(len(orders["bids"]) > 0, "Bids array should not be empty")
     ok_(orders["source"] == "CoinBase", "Source should be 'CoinBase'")
     ok_(float(orders["timestamp"]) > 0, "Timestamp should be > zero")
예제 #2
0
파일: testcbase.py 프로젝트: laisee/hokonui
 def test_ticker(cls):
     ''' method for testing ticker'''
     data = json.loads(cba.get_current_ticker(base.CCY_DEFAULT, None))
     ok_(data["pair"] == base.CCY_DEFAULT, "pair should be base.CCY_DEFAULT")
     ok_(data["ask"] > 0.00, "ask should not be empty")
     ok_(data["bid"] > 0.00, "bid should not be empty")
     ok_(data["bid"] <= data["ask"], "bid should be < ask")
     ok_(float(data["timestamp"]) > 0, "Timestamp should be > zero")
예제 #3
0
파일: testcbase.py 프로젝트: laisee/hokonui
 def test_bid(cls):
     ''' method for testing bid price'''
     ok_(cba.get_current_bid(base.CCY_DEFAULT, None) > 0.00)
예제 #4
0
파일: testcbase.py 프로젝트: laisee/hokonui
 def test_ask(cls):
     ''' method for testing ask price'''
     ok_(cba.get_current_ask(base.CCY_DEFAULT, None) > 0.00)
예제 #5
0
파일: testcbase.py 프로젝트: laisee/hokonui
 def test_price(cls):
     ''' method for testing last price'''
     ok_(cba.get_current_price(base.CCY_DEFAULT, None) > 0.00)