Exemplo n.º 1
0
    def test_component_bounds_updated(self, mock_method):
        """ Make sure trait listener for changing component bounds gets set up.
        """
        class TestWindow(AbstractWindow):
            # needed to avoid a NotImplementedError, not under test
            def _redraw(self):
                pass

            def _get_control_size(self):
                # this happens in the wild
                return None

        thing = Component()
        TestWindow(
            parent=None,
            component=thing,
        )

        thing.bounds = [13.0, 13.0]
        self.assertTrue(mock_method.called)