JFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3RbrJFIFxxC      C  " }!1AQa"q2#BR$3br %&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz w!1AQaq"2B #3Rbr Yfi@sdZddlmZddlZddlmZddlmZmZm Z ddl m Z Gdddej Z Gd d d ej Zed krejd d dS)z.Test idlelib.WidgetRedirector. 100% coverage )requiresN)Func)TkTextTclError)WidgetRedirectorc@sLeZdZeddZeddZddZddZd S) InitCloseTestcCs9tdt|_|jjt|j|_dS)Ngui)rrrootwithdrawrtext)clsrG/opt/alt/python35/lib64/python3.5/idlelib/idle_test/test_widgetredir.py setUpClasss   zInitCloseTest.setUpClasscCs|`|jj|`dS)N)r r destroy)r rrr tearDownClasss zInitCloseTest.tearDownClasscCsbt|j}|j|j|j|j|j|jj|jtt|j|jdS)N)rr assertEqualwidgettkZ assertRaisesrclose)selfredirrrr test_inits zInitCloseTest.test_initcCsYt|j}|jdt|j|j|ji|jt|jddS)Ninsertr) rr registerrrr _operations assertFalsehasattr)rrrrr test_close"s  zInitCloseTest.test_closeN)__name__ __module__ __qualname__ classmethodrrrrrrrrr s  rc@seZdZeddZeddZddZddZd d Zd d Z d dZ ddZ ddZ ddZ ddZddZddZdS)WidgetRedirectorTestcCs9tdt|_|jjt|j|_dS)Nr )rrr r rr )r rrrr,s   zWidgetRedirectorTest.setUpClasscCs*|`|jj|jj|`dS)N)r r Zupdate_idletasksr)r rrrr3s  z"WidgetRedirectorTest.tearDownClasscCsPt|j|_t|_|jjd|j|_|jjdddS)Nrasdf)rr rrfuncr orig_insertr)rrrrsetUp:s zWidgetRedirectorTest.setUpcCs$|jjdd|jjdS)Nz1.0end)r deleterr)rrrrtearDown@szWidgetRedirectorTest.tearDowncCs6|jdt|j|jdt|jdS)NZ RedirectorZOriginal)assertInreprrr')rrrr test_reprDszWidgetRedirectorTest.test_reprcCs~|j|jjddd|j|jjd|jd|jj|jd|jj|j|jj |jdS)Nz1.0r) rr%)rr%) rr getr&argsr,rr__dict__r)rrrr test_registerHs z"WidgetRedirectorTest.test_registercCsh|j|jjd|j|jj|jjj|jdd|j|jjddddS)Nrr%z1.0r)zasdf )rr'Z operationZtk_callr rcallr0)rrrrtest_original_commandOsz*WidgetRedirectorTest.test_original_commandcCsh|j|jjd|j|jjd|j|jd|jj|jd|jjdS)Nzinvalid operation namer) Z assertIsNoner unregisterrr&Z assertNotInrr r2)rrrrtest_unregisterUsz$WidgetRedirectorTest.test_unregistercCs,|j`|j|jjd|jdS)Nr)r rrrr6r&)rrrrtest_unregister_no_attribute[s z1WidgetRedirectorTest.test_unregister_no_attributecCsG|jjd|j|jjdd|j|jjddS)NTrFr)r&__init__Z assertTruerdispatchrr1)rrrrtest_dispatch_intercept_sz,WidgetRedirectorTest.test_dispatch_interceptcCsU|jdd|j|jjdddd|j|jjddddS)Nrr%r*z1.0r)r/)r'rrr:r r0)rrrrtest_dispatch_bypassds"z)WidgetRedirectorTest.test_dispatch_bypasscCsR|jjt|j|jjddd|j|jjdddS)NrFr<Zinvalid)r&r9rrrr:)rrrrtest_dispatch_errorjsz(WidgetRedirectorTest.test_dispatch_errorcCs|jj|jjdd|j|jjd|j|jjddd|jjt |j|jj|jjddddS) Nrhelloz1.0r)r/Zboor<)r?) r r4r Z_wrr&r1r0r9r)rrrrtest_command_dispatchos z*WidgetRedirectorTest.test_command_dispatchN)r r!r"r#rrr(r+r.r3r5r7r8r;r=r>r@rrrrr$*s           r$__main__ verbosity)__doc__Z test.supportrZunittestZidlelib.idle_test.mock_idlerZtkinterrrrZidlelib.WidgetRedirectorrZTestCaserr$r mainrrrrs R