Esempio n. 1
0
 def test_multiple_tsyms(self):
     """Historical price should be returned with all quote symbols passed"""
     cc = CryptoCompare()
     result = cc.get_historical_for_timestamp('BTC', ('USD', 'EUR'),
                                              int(time.time()))
     self.assertIsInstance(result['BTC']['USD'], numbers.Real)
     self.assertIsInstance(result['BTC']['EUR'], numbers.Real)
Esempio n. 2
0
 def test_specific_exchange(self):
     """Requesting historical data from a specific exchange should work"""
     cc = CryptoCompare()
     result = cc.get_historical_for_timestamp('BTC',
                                              'USD',
                                              int(time.time()),
                                              exchange='Kraken')
     self.assertIsInstance(result['BTC']['USD'], numbers.Real)
Esempio n. 3
0
 def test_yesterday(self):
     """Get historical data for yesterday should work"""
     cc = CryptoCompare()
     result = cc.get_historical_for_timestamp('BTC', 'USD',
                                              int(time.time() - 24 * 3600))
     self.assertIsInstance(result['BTC']['USD'], numbers.Real)