mirror of
https://github.com/wassname/catalyst.git
synced 2026-07-01 08:51:44 +08:00
BUG: Fix and test getting all default calendars
This commit is contained in:
@@ -27,6 +27,7 @@ from pandas import read_csv
|
||||
from pandas.tslib import Timedelta
|
||||
from pandas.util.testing import assert_index_equal
|
||||
from pytz import timezone
|
||||
from toolz import concat
|
||||
|
||||
from zipline.errors import (
|
||||
CalendarNameCollision,
|
||||
@@ -38,7 +39,8 @@ from zipline.utils.calendars import(
|
||||
deregister_calendar,
|
||||
get_calendar,
|
||||
)
|
||||
from zipline.utils.calendars.calendar_utils import register_calendar_type
|
||||
from zipline.utils.calendars.calendar_utils import register_calendar_type, \
|
||||
_default_calendar_factories
|
||||
from zipline.utils.calendars.trading_calendar import days_at_time, \
|
||||
TradingCalendar
|
||||
|
||||
@@ -119,6 +121,13 @@ class CalendarRegistrationTestCase(TestCase):
|
||||
self.assertNotEqual(first_dummy, second_dummy)
|
||||
|
||||
|
||||
class DefaultsTestCase(TestCase):
|
||||
def test_default_calendars(self):
|
||||
for name in concat(_default_calendar_factories):
|
||||
self.assertIsNotNone(get_calendar(name),
|
||||
"get_calendar(%r) returned None" % name)
|
||||
|
||||
|
||||
class DaysAtTimeTestCase(TestCase):
|
||||
@parameterized.expand([
|
||||
# NYSE standard day
|
||||
|
||||
Reference in New Issue
Block a user