BUG: Getting continuous future current contract failed on None

This commit is contained in:
dmichalowicz
2017-03-30 12:09:55 -04:00
parent 0bcdb640ca
commit 69a0e5c31b
3 changed files with 23 additions and 6 deletions
+10
View File
@@ -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)