docstr: Test that we maintain backwards compat for sid access on a data object.
  
  We want to support both data[sid(24)].sid, as well as
  data[sid(24)]["sid"]. Since these are deprecated and will eventually
  cease to be supported, we also want to assert that we're seeing a
  deprecation warning.
docstr_tok: ["Test","that","we","maintain","backwards","compat","for","sid","access","on","a","data","object",".","We","want","to","support","both","data","[","sid","(","24",")","]",".sid",",","as","well","as","data","[","sid","(","24",")","]","[","``","sid","''","]",".","Since","these","are","deprecated","and","will","eventually","cease","to","be","supported",",","we","also","want","to","assert","that","we","'re","seeing","a","deprecation","warning","."]
code: def test_sid_accessor(self):
      """
      Test that we maintain backwards compat for sid access on a data object.
  
      We want to support both data[sid(24)].sid, as well as
      data[sid(24)]["sid"]. Since these are deprecated and will eventually
      cease to be supported, we also want to assert that we're seeing a
      deprecation warning.
      """
      with warnings.catch_warnings(record=True) as w:
          warnings.simplefilter("ignore", PerformanceWarning)
          warnings.simplefilter("default", ZiplineDeprecationWarning)
          algo = self.create_algo(sid_accessor_algo)
          algo.run()
  
          # Since we're already raising a warning on doing data[sid(x)],
          # we don't want to raise an extra warning on data[sid(x)].sid.
          self.assertEqual(2, len(w))
  
          # Check that both the warnings raised were in fact
          # ZiplineDeprecationWarnings
          for warning in w:
              self.assertEqual(
                  ZiplineDeprecationWarning, warning.category
              )
              self.assertEqual(
                  "`data[sid(N)]` is deprecated. Use `data.current`.",
                  str(warning.message),
              )
  
imports: import warnings
  from mock import patch
  import numpy
  import pandas
  from pandas.core.common import PerformanceWarning
  from zipline.finance.trading import SimulationParameters
  from zipline.testing import MockDailyBarReader, create_daily_df_for_asset, create_minute_df_for_asset, str_to_seconds
  from zipline.testing.fixtures import WithCreateBarData, WithMakeAlgo, ZiplineTestCase
  from zipline.zipline_warnings import ZiplineDeprecationWarning
label_desc: Use image node_id 8 for calling the TestAPIShim obj's underlying member method code with example usage: obj.test_sid_accessor() without return types