Revert "delete live bittrex test"

This reverts commit f70343bb
This commit is contained in:
Jack Robison 2020-03-26 20:31:39 -04:00
parent baf926b360
commit d46d012f8c
No known key found for this signature in database
GPG key ID: DF25C68FE0239BB2

View file

@ -0,0 +1,22 @@
from decimal import Decimal
from lbry.testcase import AsyncioTestCase
from lbry.extras.daemon.exchange_rate_manager import ExchangeRate, ExchangeRateManager, FEEDS
class TestExchangeRateManager(AsyncioTestCase):
async def test_exchange_rate_manager(self):
# TODO: re-enable cryptonator.com
manager = ExchangeRateManager(FEEDS)
manager.start()
self.addCleanup(manager.stop)
for feed in manager.market_feeds:
self.assertFalse(feed.is_online)
self.assertIsNone(feed.rate)
await manager.wait()
for feed in manager.market_feeds:
self.assertTrue(feed.is_online)
self.assertIsInstance(feed.rate, ExchangeRate)
lbc = manager.convert_currency('USD', 'LBC', Decimal('0.01'))
self.assertGreaterEqual(lbc, 0.1)
self.assertLessEqual(lbc, 10.0)