示例#1
0
 def test_bitcoin_multiple_tsyms(self):
     """Requesting multiple price for multiple quote symbols should work"""
     cc = CryptoCompare()
     tsyms = ['USD', 'EUR', 'JPY', 'ETH']
     result = cc.get_symbols_full_data('BTC', tsyms)
     for symbol in tsyms:
         self.assertIn(symbol, result['RAW']['BTC'].keys())
         self.assertIn(symbol, result['DISPLAY']['BTC'].keys())
示例#2
0
 def test_multiple_fsyms_and_tsyms(self):
     """Requesting multiple price for multiple base and quote symbols should work"""
     cc = CryptoCompare()
     fsyms = ['BTC', 'LTC', 'ETH']
     tsyms = ['USD', 'EUR']
     result = cc.get_symbols_full_data(fsyms, tsyms)
     for fs in fsyms:
         for ts in tsyms:
             self.assertIn(ts, result['RAW'][fs])
             self.assertIn(ts, result['DISPLAY'][fs])
示例#3
0
 def test_bitcoin_usd_specific_exchange(self):
     """Request BTC/USD price on specific exchange should work"""
     cc = CryptoCompare()
     result = cc.get_symbols_full_data('BTC', 'USD', exchange='Bitstamp')
     self.assertIsInstance(result['RAW']['BTC']['USD']['PRICE'],
                           numbers.Real)
示例#4
0
 def test_bitcoin_lowercase(self):
     """Working with lowercase symbols should work"""
     cc = CryptoCompare()
     result = cc.get_symbols_full_data('btc', 'usd')
     self.assertIsInstance(result['RAW']['BTC']['USD']['PRICE'],
                           numbers.Real)
示例#5
0
 def test_bitcoin_usd(self):
     """Request BTC/USD price should return that pair rate"""
     cc = CryptoCompare()
     result = cc.get_symbols_full_data('BTC', 'USD')
     self.assertIsInstance(result['RAW']['BTC']['USD']['PRICE'],
                           numbers.Real)