def test_ticker(cls): ''' method for testing ticker ''' data = json.loads(avg.get_current_ticker(base.CCY_DEFAULT)) ok_(data["pair"] == base.CCY_DEFAULT, "shd be '%s'" % 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")
def test_volume(cls): ''' method for testing volumes ''' vol = avg.get_current_volume(base.CCY_DEFAULT) ok_(float(vol["quantity"]) >= 0, "quantity shd be valid number >= 0") ok_(vol["source"] == "BitcoinAverage", "Source should be 'BitcoinAverage'") ok_(float(vol["timestamp"]) > 0, "Timestamp should be greater than zero")
def test_bid(cls): ''' method for testing bid price ''' ok_(avg.get_current_bid(base.CCY_DEFAULT) > 0.00)
def test_ask(cls): ''' method for testing ask price ''' ok_(avg.get_current_ask(base.CCY_DEFAULT) > 0.00)
def test_price(cls): ''' method for testing last price ''' ok_(avg.get_current_price(base.CCY_DEFAULT) > 0.00)