'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.'

def test_sid_accessor(self):

    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(self.data_portal)
        self.assertEqual(2, len(w))
        for warning in w:
            self.assertEqual(ZiplineDeprecationWarning, warning.category)
            self.assertEqual('`data[sid(N)]`    is    deprecated.    Use    `data.current`.', str(warning.message))
