

def test_apply_roi(self):
    self.client.add_layer(self.data)
    self.client.set_component(self.data.id['x'])
    roi.data.edit_subset = [self.data.subsets[0]]
    roi = MagicMock()
    roi.to_polygon.return_value = ([1.2, 2, 4], [2, 3, 4])
    self.client.apply_roi(roi)
    state = self.data.subsets[0].subset_state
    assert isinstance(state, CategoricalROISubsetState)
    np.testing.assert_equal(self.data.subsets[0].subset_state.roi.categories, np.array(['b', 'c', 'd', 'e']))

dataset/ETHPy150Open glue-viz/glue/glue/viewers/histogram/tests/test_client.py TestCategoricalHistogram.test_apply_roi/VarMisuse@37/44 `self`->`roi`