'Test that slices can be created by indexing into a term, and that they
have the correct shape when used as inputs.'

@parameter_space(my_asset_column=[0, 1, 2], window_length_=[1, 2, 3])
def test_slice(self, my_asset_column, window_length_):

    sids = self.sids
    my_asset = self.asset_finder.retrieve_asset(self.sids[my_asset_column])
    returns = Returns(window_length=2, inputs=[self.col])
    returns_slice = returns[my_asset]
    class UsesSlicedInput(CustomFactor, ):
        window_length = window_length_
        inputs = [returns, returns_slice]
        def compute(self, today, assets, out, returns, returns_slice):
            assert (returns_slice.shape == (self.window_length, 1))
            assert (returns.shape == (self.window_length, len(sids)))
            check_arrays(returns_slice[:, 0], returns[:, my_asset_column])
    self.run_pipeline(Pipeline(columns={'uses_sliced_input': UsesSlicedInput()}), self.pipeline_start_date, self.pipeline_end_date)
