'Tests the future_symbol API function.'

def test_future_symbol(self):

    algo = TradingAlgorithm(env=self.env)
    algo.datetime = pd.Timestamp('2006-12-01', tz='UTC')
    cl = algo.future_symbol('CLG06')
    self.assertEqual(cl.sid, 5)
    self.assertEqual(cl.symbol, 'CLG06')
    self.assertEqual(cl.root_symbol, 'CL')
    self.assertEqual(cl.start_date, pd.Timestamp('2005-12-01', tz='UTC'))
    self.assertEqual(cl.notice_date, pd.Timestamp('2005-12-20', tz='UTC'))
    self.assertEqual(cl.expiration_date, pd.Timestamp('2006-01-20', tz='UTC'))
    with self.assertRaises(SymbolNotFound):
        algo.future_symbol('')
    with self.assertRaises(SymbolNotFound):
        algo.future_symbol('PLAY')
    with self.assertRaises(SymbolNotFound):
        algo.future_symbol('FOOBAR')
    with self.assertRaises(TypeError):
        algo.future_symbol(1)
    with self.assertRaises(TypeError):
        algo.future_symbol((1,))
    with self.assertRaises(TypeError):
        algo.future_symbol({1})
    with self.assertRaises(TypeError):
        algo.future_symbol([1])
    with self.assertRaises(TypeError):
        algo.future_symbol({'foo': 'bar'})
