|G_Tc@s\dZddlmZdefdYZdefdYZdefdYZd S( sqMock classes that imitate idlelib modules or classes. Attributes and methods will be added as needed for tests. i(tTexttFunccBs#eZdZddZdZRS(sMock function captures args and returns result set by test. Attributes: self.called - records call even if no args, kwds passed. self.result - set by init, returned by call. self.args - captures positional arguments. self.kwds - captures keyword arguments. Most common use will probably be to mock methods. Mock_tk.Var and Mbox_func are special variants of this. cCs(t|_||_d|_d|_dS(N(tFalsetcalledtresulttNonetargstkwds(tselfR((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pyt__init__s   cOs"t|_||_||_|jS(N(tTrueRRRR(RRR((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pyt__call__s   N(t__name__t __module__t__doc__RR R (((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pyRs  tEditorcBs,eZdZdddddZdZRS(s7Minimally imitate EditorWindow.EditorWindow class. cCst|_t|_dS(N(Rttextt UndoDelegatortundo(Rtflisttfilenametkeytroot((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pyR #s cCs.|jjd}|jjd}||fS(Ns1.0tend(Rtindex(Rtfirsttlast((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pytget_selection_indices'sN(R R RRR R(((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pyR sRcBs eZdZdZdZRS(s9Minimally imitate UndoDelegator,UndoDelegator class. cGsdS(N((R((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pytundo_block_start1scGsdS(N((R((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pytundo_block_stop3s(R R RRR(((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pyR-s N(Rtidlelib.idle_test.mock_tkRtobjectRRR(((s7/usr/local/lib/python2.7/idlelib/idle_test/mock_idle.pyts