    def test_pop_up_no_buttons(self):
        """
        Check dialog with nobuttons work as expected.
        """
        def test_on_click(selection):
            raise NextScene(str(selection))

        screen = MagicMock(spec=Screen, colours=8, unicode_aware=False)
        scene = Scene([], -1)
        canvas = Canvas(screen, 10, 40, 0, 0)
        form = PopUpDialog(canvas, "Message", [], test_on_click)
        scene.add_effect(form)
        form.reset()

        # Check that the pop-up is rendered correctly.
        form.update(0)
        self.assert_canvas_equals(
            canvas,
            "                                        \n" +
            "                                        \n" +
            "                                        \n" +
            "               +-------+                \n" +
            "               |Message|                \n" +
            "               +-------+                \n" +
            "                                        \n" +
            "                                        \n" +
            "                                        \n" +
            "                                        \n")
Check dialog with nobuttons work as expected.
tests/test_widgets.py