mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-27 20:51:34 +08:00
BLD: adjusted tests
This commit is contained in:
@@ -43,16 +43,16 @@ class TestExchangeBundle:
|
||||
|
||||
def test_ingest_minute(self):
|
||||
data_frequency = 'minute'
|
||||
exchange_name = 'binance'
|
||||
exchange_name = 'poloniex'
|
||||
|
||||
exchange = get_exchange(exchange_name)
|
||||
exchange_bundle = ExchangeBundle(exchange_name)
|
||||
assets = [
|
||||
exchange.get_asset('cmt_bnb')
|
||||
exchange.get_asset('bch_eth')
|
||||
]
|
||||
|
||||
start = pd.to_datetime('2018-03-01', utc=True)
|
||||
end = pd.to_datetime('2018-03-07', utc=True)
|
||||
start = pd.to_datetime('2018-01-01', utc=True)
|
||||
end = pd.to_datetime('2018-03-01', utc=True)
|
||||
# start = None
|
||||
# end = None
|
||||
|
||||
|
||||
@@ -198,7 +198,7 @@ class TestSuiteBundle:
|
||||
# features=[bundle],
|
||||
# ) # Type: list[Exchange]
|
||||
# TODO: currently focusing on Binance, try other exchanges
|
||||
exchanges = [get_exchange('binance', skip_init=True)]
|
||||
exchanges = [get_exchange('poloniex', skip_init=True)]
|
||||
|
||||
data_portal = TestSuiteBundle.get_data_portal(exchanges)
|
||||
for exchange in exchanges:
|
||||
@@ -206,7 +206,7 @@ class TestSuiteBundle:
|
||||
|
||||
frequencies = exchange.get_candle_frequencies(data_frequency)
|
||||
# freq = random.sample(frequencies, 1)[0]
|
||||
freq = '15T'
|
||||
freq = '5T'
|
||||
rnd = random.SystemRandom()
|
||||
# field = rnd.choice(['open', 'high', 'low', 'close', 'volume'])
|
||||
field = rnd.choice(['close'])
|
||||
@@ -217,8 +217,8 @@ class TestSuiteBundle:
|
||||
# assets = select_random_assets(
|
||||
# exchange.assets, asset_population
|
||||
# )
|
||||
assets = [exchange.get_asset('cmt_bnb')]
|
||||
end_dt = pd.to_datetime('2018-03-07', utc=True)
|
||||
assets = [exchange.get_asset('bch_eth')]
|
||||
end_dt = pd.to_datetime('2018-03-01', utc=True)
|
||||
for asset in assets:
|
||||
attribute = 'end_{}'.format(data_frequency)
|
||||
asset_end_dt = getattr(asset, attribute)
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
from catalyst.marketplace.marketplace import Marketplace
|
||||
from catalyst.testing.fixtures import WithLogger, ZiplineTestCase
|
||||
import pandas as pd
|
||||
|
||||
|
||||
class TestMarketplace(WithLogger, ZiplineTestCase):
|
||||
@@ -16,12 +15,12 @@ class TestMarketplace(WithLogger, ZiplineTestCase):
|
||||
|
||||
def test_subscribe(self):
|
||||
marketplace = Marketplace()
|
||||
marketplace.subscribe('marketcap2222')
|
||||
marketplace.subscribe('marketcap')
|
||||
pass
|
||||
|
||||
def test_ingest(self):
|
||||
marketplace = Marketplace()
|
||||
ds_def = marketplace.ingest('github')
|
||||
ds_def = marketplace.ingest('marketcap')
|
||||
pass
|
||||
|
||||
def test_publish(self):
|
||||
|
||||
Reference in New Issue
Block a user