示例#1
0
    def make_mock_editor_window(self, with_text_widget=False):
        """Create a mock EditorWindow instance."""
        editwin = NonCallableMagicMock()
        editwin.width = 80

        if with_text_widget:
            editwin.root = get_test_tk_root(self)
            text_widget = self.make_text_widget(root=editwin.root)
            editwin.text = editwin.per.bottom = text_widget

        return editwin
示例#2
0
    def make_mock_editor_window(self, with_text_widget=False):
        """Create a mock EditorWindow instance."""
        editwin = NonCallableMagicMock()
        # isinstance(editwin, PyShell) must be true for Squeezer to enable
        # auto-squeezing; in practice this will always be true.
        editwin.__class__ = PyShell

        if with_text_widget:
            editwin.root = get_test_tk_root(self)
            text_widget = self.make_text_widget(root=editwin.root)
            editwin.text = editwin.per.bottom = text_widget

        return editwin
    def make_mock_editor_window(self, with_text_widget=False):
        """Create a mock EditorWindow instance."""
        editwin = NonCallableMagicMock()
        # isinstance(editwin, PyShell) must be true for Squeezer to enable
        # auto-squeezing; in practice this will always be true.
        editwin.__class__ = PyShell

        if with_text_widget:
            editwin.root = get_test_tk_root(self)
            text_widget = self.make_text_widget(root=editwin.root)
            editwin.text = editwin.per.bottom = text_widget

        return editwin