blob: c364a24dacbf77f1ccd91b9159590bdfa9a9cae8 [file] [log] [blame]
Terry Jan Reedy4f133e22013-07-13 02:34:43 -04001'''Mock classes that imitate idlelib modules or classes.
2
3Attributes and methods will be added as needed for tests.
4'''
5
6from idlelib.idle_test.mock_tk import Text
7
8class Editor:
9 '''Minimally imitate EditorWindow.EditorWindow class.
10 '''
11 def __init__(self, flist=None, filename=None, key=None, root=None):
12 self.text = Text()
13 self.undo = UndoDelegator()
14
15 def get_selection_indices(self):
16 first = self.text.index('1.0')
17 last = self.text.index('end')
18 return first, last
19
20class UndoDelegator:
21 '''Minimally imitate UndoDelegator,UndoDelegator class.
22 '''
23 # A real undo block is only needed for user interaction.
24 def undo_block_start(*args):
25 pass
26 def undo_block_stop(*args):
27 pass