TST: Fix broken tests, updated example data

This commit is contained in:
Jean Bredeche
2016-08-04 09:38:18 -04:00
parent 7d4b19a7f0
commit d1077a36c2
3 changed files with 11 additions and 3 deletions
Binary file not shown.
+4 -1
View File
@@ -163,7 +163,7 @@ from zipline.test_algorithms import (
no_handle_data,
)
from zipline.utils.api_support import ZiplineAPI, set_algo_instance
from zipline.utils.calendars import get_calendar
from zipline.utils.calendars import get_calendar, register_calendar
from zipline.utils.context_tricks import CallbackManager
from zipline.utils.control_flow import nullctx
import zipline.utils.events
@@ -1453,6 +1453,8 @@ class TestAlgoScript(WithLogger,
@classmethod
def make_equity_info(cls):
register_calendar("TEST", get_calendar("NYSE"), force=True)
data = make_simple_equity_info(
cls.sids,
cls.START_DATE,
@@ -1787,6 +1789,7 @@ def handle_data(context, data):
Test that api methods on the data object can be called with positional
arguments.
"""
params = SimulationParameters(
start_session=pd.Timestamp("2006-01-10", tz='UTC'),
end_session=pd.Timestamp("2006-01-11", tz='UTC'),
+7 -2
View File
@@ -431,6 +431,7 @@ class AssetFinderTestCase(WithTradingCalendar, ZiplineTestCase):
'symbol': 'TEST.%d' % sid,
'start_date': as_of.value,
'end_date': as_of.value,
'exchange': uuid.uuid4().hex
}
for sid in sids
]
@@ -480,8 +481,8 @@ class AssetFinderTestCase(WithTradingCalendar, ZiplineTestCase):
def test_lookup_symbol_fuzzy(self):
metadata = pd.DataFrame.from_records([
{'symbol': 'PRTY_HRD', 'exchange': "TEST"},
{'symbol': 'BRKA', 'exchange': "TEST",},
{'symbol': 'BRK_A', 'exchange': "TEST",},
{'symbol': 'BRKA', 'exchange': "TEST"},
{'symbol': 'BRK_A', 'exchange': "TEST"},
])
self.write_assets(equities=metadata)
finder = self.asset_finder
@@ -524,11 +525,13 @@ class AssetFinderTestCase(WithTradingCalendar, ZiplineTestCase):
'symbol': 'A',
'start_date': T('2014-01-01'),
'end_date': T('2014-01-05'),
'exchange': "TEST",
},
{
'symbol': 'B',
'start_date': T('2014-01-06'),
'end_date': T('2014-01-10'),
'exchange': "TEST",
},
# sid 1
@@ -536,11 +539,13 @@ class AssetFinderTestCase(WithTradingCalendar, ZiplineTestCase):
'symbol': 'C',
'start_date': T('2014-01-01'),
'end_date': T('2014-01-05'),
'exchange': "TEST",
},
{
'symbol': 'A', # claiming the unused symbol 'A'
'start_date': T('2014-01-06'),
'end_date': T('2014-01-10'),
'exchange': "TEST",
},
],
index=[0, 0, 1, 1],