code: def test_current_contract_in_algo(self):
      code = dedent(
          """
  from zipline.api import (
      record,
      continuous_future,
      schedule_function,
      get_datetime,
  )
  
  def initialize(algo):
      algo.primary_cl = continuous_future('FO', 0, 'calendar', None)
      algo.secondary_cl = continuous_future('FO', 1, 'calendar', None)
      schedule_function(record_current_contract)
  
  def record_current_contract(algo, data):
      record(datetime=get_datetime())
      record(primary=data.current(algo.primary_cl, 'contract'))
      record(secondary=data.current(algo.secondary_cl, 'contract'))
  """
      )
      results = self.run_algorithm(script=code)
      result = results.iloc[0]
  
      self.assertEqual(
          result.primary.symbol,
          "FOF16",
          "Primary should be FOF16 on first session.",
      )
      self.assertEqual(
          result.secondary.symbol,
          "FOG16",
          "Secondary should be FOG16 on first session.",
      )
  
      result = results.iloc[1]
      # Second day, primary should switch to FOG
      self.assertEqual(
          result.primary.symbol,
          "FOG16",
          "Primary should be FOG16 on second session, auto "
          "close is at beginning of the session.",
      )
      self.assertEqual(
          result.secondary.symbol,
          "FOH16",
          "Secondary should be FOH16 on second session, auto "
          "close is at beginning of the session.",
      )
  
      result = results.iloc[2]
      # Second day, primary should switch to FOG
      self.assertEqual(
          result.primary.symbol,
          "FOG16",
          "Primary should remain as FOG16 on third session.",
      )
      self.assertEqual(
          result.secondary.symbol,
          "FOH16",
          "Secondary should remain as FOH16 on third session.",
      )
  
imports: from collections import deque
  from functools import partial
  from textwrap import dedent
  from numpy import arange, array, int64, full, repeat, tile
  from numpy.testing import assert_almost_equal
  import pandas
  from pandas import Timestamp, DataFrame
  from zipline.assets.continuous_futures import OrderedContracts, delivery_predicate
  from zipline.assets.roll_finder import ROLL_DAYS_FOR_CURRENT_CONTRACT, VolumeRollFinder
  from zipline.data.minute_bars import FUTURES_MINUTES_PER_DAY
  from zipline.errors import SymbolNotFound
  import zipline.testing.fixtures
label_desc: Use image node_id 10 for calling the ContinuousFuturesTestCase obj's underlying member method code with example usage: obj.test_current_contract_in_algo() without return types