7ec@sddlZddlmZddlmZdefdYZdeejfdYZdeejfd YZ e d krej d d d e ndS(iN(trequires(tTclErrortTextTestcBseZdZedZd ZdZdZdZdZ dZ dZ dZ d Z d Zd Zd ZRS(s hello worlds cCs|j|_dS(N(tTextttext(tself((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pytsetUp scCs<|j|jjdd|j|jjdddS(Ns1.0s tendt(t assertEqualRtget(R((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyt test_initscCs^|jj}x$dD]}|j||dqWx$dD]}|j||d q:WdS(Ngg333333?s1.-1s1.0s 1.0 lineends1.ends1.33tinsertRg@s2.1s33.44s2.0(gg333333?s1.-1s1.0s 1.0 lineends1.ends1.33R (Rg@s2.1s33.44(RtindexR (RR tdex((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyttest_index_emptys    cCs|jj}|jjd|jx$d D]}|j||dq)Wx$d D]}|j||dqPWx$dD]}|j||d qwWdS(Ns1.0gg333333?s1.-1s 1.0 lineends1.ends1.33s1.5Rs33.44s3.0(gg333333?s1.-1s1.0(s 1.0 lineends1.ends1.33(Rs33.44(RR R thwR (RR R((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyttest_index_datas    cCsM|jj}|j}|jjd|j||dd||ddd||dd||ddd||ddd||ddd||dd d ||dd d ||d d ||dd d||dd|j||dd|j||dd|jdS(Ns1.0RRths1.1s1.3theltels 1.0 lineendthellos1.10s s2.3sello wors2.5s0.0s5.0(RR R R Rthwn(RR tEqual((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyttest_get+s   cCs#|jj}|jj}|j}|d|j||dd|j|dd||dd|j|dd||ddd|dd||ddd|dd||ddd |dd ||ddd |d d ||ddddS(Ns1.0RRt*s *hello world s 1.0 lineends*hello* world s2.3s*hello* wor*ld txs*hello* wor*ldx s1.4sx s*helx lo* wor*ldx (RR R R RR(RR R R((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyt test_insert>s"         cCs|jj}|jj}|j}|jjd|j|d||dd|j|d||dd|j|dd||dd|j|dd||dd|j|dd||dd|j|dd||dd|jdS(Ns1.0R Rs5.5s1.4(RtdeleteR R R RR(RRR R((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyttest_no_deleteXs          cCs|jj}|jj}|j}|jjd|j|d||ddd|dd||ddd|d||ddd|jjdd|d ||ddd|jjdd|dd ||ddddS( Ns1.0s1.endtellos1.1tllotlloworlds1.3s s1.10s2.0(RRR R R R(RRR R((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyttest_delete_charqs         cCs|jj}|jj}|j}|jjd|j|dd||ddd|dd||ddd|jjd|j|dd||ddd|dd||ddd|jjd|j|dd ||ddd dS( Ns1.0s 1.0 lineendRs world s s2.0sworld s1.2s2.3sheld (RRR R R R(RRR R((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyttest_delete_slices         cCs{|jjdd|jjdd|j|jjddd|jjdd|j|jjddddS( Ns1.0Rs1.3s 1 2 3 4 5Rshel1 2 3 4 5lo s5.1shello (RR R R R(R((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyttest_multiple_liness c Csr|jj}|j}|jjdd|jt|dddx*dtttttfdtttttfdtttttfdtttttfd tttttfd tttttffD]\}}}}}}||d |d||||d |d||||d|d||||d |d||||d|d||qWdS(Ns1.0sFirst Second Third s2.2topts>=s==s!=s1.1s2.1s2.3s3.3(RtcompareR R t assertRaisesRtTruetFalse( RR'RR$tless1tless0tequaltgreater0tgreater1((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyt test_compares   1N(t__name__t __module__RRtNoneRRR RRRRRR!R"R#R0(((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyRs         t MockTextTestcBs eZedZdZRS(cCsddlm}||_dS(Ni(R(tidlelib.idle_test.mock_tkR(tclsR((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyt setUpClassscCs|jj}|j}|jjd|j||ddd ||ddd ||ddd ||ddd dS( Ns1.0Riiis3.1ii(ii(ii(ii(ii(Rt_decodeR R R(RtdecodeR((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyt test_decodes  (R1R2t classmethodR7R:(((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyR4st TkTextTestcBs&eZedZedZRS(cCs9tdddlm}m}||_||_dS(Ntguii(tTkR(RtTkinterR>Rtroot(R6R>R((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyR7s  cCs|jj|`dS(N(R@tdestroy(R6((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyt tearDownClasss (R1R2R;R7RB(((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyR<st__main__t verbosityitexit( tunittestttest.test_supportRt_tkinterRtobjectRtTestCaseR4R<R1tmainR*(((s3/usr/lib64/python2.7/idlelib/idle_test/test_text.pyts