mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-07 11:20:19 +08:00
BUG: Getting continuous future current contract failed on None
This commit is contained in:
@@ -467,6 +467,16 @@ class ContinuousFuturesTestCase(WithCreateBarData,
|
||||
'Auto close at beginning of session so FOG16 is now '
|
||||
'the current contract.')
|
||||
|
||||
# Test that the current contract outside of the continuous future's
|
||||
# start and end dates is None.
|
||||
contract = self.data_portal.get_spot_value(
|
||||
cf_primary,
|
||||
'contract',
|
||||
self.START_DATE - self.trading_calendar.day,
|
||||
'daily',
|
||||
)
|
||||
self.assertIsNone(contract)
|
||||
|
||||
def test_get_value_close_daily(self):
|
||||
cf_primary = self.asset_finder.create_continuous_future(
|
||||
'FO', 0, 'calendar', None)
|
||||
|
||||
Reference in New Issue
Block a user