|
15 | 15 | from Orange.widgets.visualize.owmosaic import OWMosaicDisplay |
16 | 16 | from Orange.widgets.tests.utils import simulate |
17 | 17 |
|
| 18 | + |
18 | 19 | class TestOWMosaicDisplay(WidgetTest, WidgetOutputsTestMixin): |
19 | 20 | @classmethod |
20 | 21 | def setUpClass(cls): |
@@ -112,6 +113,22 @@ def test_different_number_of_attributes(self, canvas_rectangle): |
112 | 113 | self.widget.update_graph() |
113 | 114 | self.assertEqual(canvas_rectangle.call_count, 7 + 2 ** (i + 1)) |
114 | 115 |
|
| 116 | + def test_change_domain(self): |
| 117 | + """Test for GH-3419 fix""" |
| 118 | + self.send_signal(self.widget.Inputs.data, self.data[:, :2]) |
| 119 | + subset = self.data[:1, 2:3] |
| 120 | + self.send_signal(self.widget.Inputs.data, subset) |
| 121 | + output = self.get_output(self.widget.Outputs.annotated_data) |
| 122 | + np.testing.assert_array_equal(output.X, subset.X) |
| 123 | + |
| 124 | + def test_subset(self): |
| 125 | + """Test for GH-3416 fix""" |
| 126 | + self.send_signal(self.widget.Inputs.data, self.data) |
| 127 | + self.send_signal(self.widget.Inputs.data_subset, self.data[10:]) |
| 128 | + self.send_signal(self.widget.Inputs.data, self.data[:1]) |
| 129 | + output = self.get_output(self.widget.Outputs.annotated_data) |
| 130 | + np.testing.assert_array_equal(output.X, self.data[:1].X) |
| 131 | + |
115 | 132 |
|
116 | 133 | # Derive from WidgetTest to simplify creation of the Mosaic widget, although |
117 | 134 | # we are actually testing the MosaicVizRank dialog and not the widget |
|
0 commit comments