nfc @sddlZddlZddlZddlmZmZddlZddlZddlm Z m Z eddej fdYZ dej fdYZ d ej fd YZd ej fd YZd ej fdYZdej fdYZdej fdYZdej fdYZdej fdYZdej fdYZe e eeeeeeeef ZedkreendS(iN(trequirest run_unittest(t MockTclObjt MockStateSpectguit WidgetTestcBs2eZdZdZdZdZdZRS(s,Tests methods available in every ttk widget.cCsCtjtjdddd|_|jj|jjdS(NtwidthittexttText(tsupporttroot_deiconifytttktButtontwidgettpacktwait_visibility(tself((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pytsetUps  cCs|jjtjdS(N(R tdestroyR t root_withdraw(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttearDowns cCs|jj|j|jjt|jjdt|jjdd|j|jjddd|jtj |jjdd|jtj |jjdd|jtj |jjdddS(Nitlabeliti( R tupdate_idletaskst assertEqualtidentifytintt winfo_widtht winfo_heightt assertRaisestTkintertTclErrortNone(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_identifys cCs|j|jjd |j|jjdgt|j|jjdgd |j|jjdgd |j|jjddgd |j|jjddgd|j|jjddgdd}|j|jjdg|didd6didd6f|jj}|jtj|jjd g|jtj|jjdd g|j||jj|jjddg|j|jjddS(Ns !disabledtdisabledtactives!activec[s ||fS(N((targ1tkw((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_cb7sthittheretmsgtbadstate((s !disabled((s!activeR"(((R#(RR tstatetinstatetTrueRRR(RR&t currstate((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_widget_state's(""   (t__name__t __module__t__doc__RRR!R/(((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR s    t ButtonTestcBseZdZRS(cs<gtjdfd}|j|jdS(Ntcommandcs jdS(Ni(tappend((tsuccess(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pytOs(R R tinvoket assertTrue(Rtbtn((R6s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_invokeMs (R0R1R;(((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR3KstCheckbuttonTestcBseZdZRS(csgfd}tjd|}|j|jd |jtj|jj|d|j }|j|d|j|d|jj|d|j d|d<|j }|j|d|j t dk|j|d |jj|ddS( NcsjddS(Niscb test called(R5((R6(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pytcb_testXs R4t alternatetvariablescb test calledtonvalueRitoffvalue(R>( R t CheckbuttonRR+RRRttkt globalgetvarR8R9t assertFalsetlen(RR=tcbtntres((R6s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR;Vs"       (R0R1R;(((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR<Tst ComboboxTestcBs>eZdZdZdZdZdZdZRS(cCstjtj|_dS(N(R R R tComboboxtcombo(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRss cCs|jjtjdS(N(RKRR R(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRws cCs`|jj}|jjdd|ddd|jjdd|ddd|jjdS(Nstxitys(RKRtevent_generateR(RR((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt_show_drop_down_listbox{s  csgdg|jd<|jjdfd|jj|jj|jj}|j|jj|jjd|jj|jdS(Nitvaluess<>cs jtS(N(R5R-(tevt(R6(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR7ss( RKtbindRRRROtupdateRNR9(Rtheight((R6s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_virtual_events      cs~gfd|jd<|jj|jj|j|jd|jd<|j|jtddS(Ncs jtS(N(R5R-((R6(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR7st postcommandRi(RKRRROR9RRF(R((R6s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_postcommands      csfd}|dddddgjd<jjd|ddjjd |dd jjd |d djjddjd<|ddjjddddgjjdddddgjd<jjdddddgjd<jjddjtjjjtjdjtjjjdt j ddddg}j|dd|j dS(Ncs6jjj|jjj|dS(N(RRKtgettcurrent(tgetvaltcurrval(R(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pytcheck_get_currentsRitaitcRPiitdit1t2sa bsa bsa bsa\tbs"a"s} {(iiRi(R`RRa(sa bsa bsa b(sa\tbs"a"s} {(R`RaR( RKtsetRYt configureRRRRRFR RJR(RR\tcombo2((Rs9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_valuess0      (R0R1RRRORURWRe(((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRIqs      t EntryTestcBsGeZdZdZdZdZdZdZdZRS(cCstjtj|_dS(N(R R R tEntrytentry(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs cCs|jjtjdS(N(RhRR R(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs cCs|jt|jjddx0|jjdD]}|jt|tq5W|jtj |jjd|jtj |jjddS(Niitnoindex( RRFRhtbboxR9t isinstanceRRRRR (Rtitem((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_bboxs "cCs|jj|jj|jj|j|jjddd|j|jjddd|jtj|jjdd|jtj|jjdd|jtj|jjdddS(NittextareaiR( RhRRRRRRRRR (R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR!s   cs#gfd}d|jd>cs jS(N(tpop(RQ(tfailure(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR7si tfromtfrom_ittoiiii(RRRRERc(Rtfuncid((Rs9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_custom_events    cCs|jj}|j|jj|d|jd|j|jjdd|jd|j|jj|jdd|jd<|j|jj|jd|jtj|jjdd|jtj|jjdddS(NiRRRiR(RRRRXRRR(Rt scale_width((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_gets&&   cCs|jd}|d}|jj||j|jj||jd}|jj|d|j|jj|tj}||jd<|j|d|j|jj|j|j|jj|d~|d|jd<|j|jj|d|j|jj|jd|j|jjdd||j|jj|jjd||jtj|jjddS( NRi RiR?iRi( RRbRRXRt DoubleVarRRRR (Rtmaxtnew_maxtmintvar((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_sets&      ((R0R1RRRRR(((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs     t NotebookTestcBskeZdZdZdZdZdZdZdZdZ dZ d Z d Z RS( cCsstjtjdd|_tj|_tj|_|jj|jdd|jj|jdddS(NtpaddingiRR]R( R R R tNotebooktnbRtchild1RR(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs  cCs5|jj|jj|jjtjdS(N(RRRRR R(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR's   cCs|jjd|jj|j|jtj|jj|j|j |jj dd|jj |j|j |jj dd|jj |j|j |jjd|jj |jdd|jj|jjtjdkrd}nd }|j |jj||jjdxhtd d d D]G}y*|jjd |dddkrtPnWqEtjk rqEXqEW|jd dS(NiR{iRYRR]tdarwins@20,5s@5,5iids@%d, 5sTab with text 'a' not found(RRthideRRRRttabRRtindexRtselectR9RRtsystplatformtrangeR tfail(Rttb_idxti((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_tab_identifiers.s,   ("cCs|jtj|jjd|jtj|jjd|jtj|jjd|jtj|jjd|jtj|jjtjdd|jj }|jj|j |jj|j |j |jj |tj}|jj|dd|jj }|jj d}|jj |j }|jj|j |jj|j |j |jj ||j |jj |j ||jt|j |jj |k|j |jj d|ddS( NiR'tunknowntoptionRR^RYi(RRRRRR RR RttabsRRRRR9R(RRRtcurrt child2_index((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_add_and_hiddenMs*! )cCs1|jtj|jjd|jtj|jjd|jtj|jjd|jj}|jj|j}|jj|j|j t |j|jjk|j t |dt |jj|jj |j|j |jj|jd|j ||jj|jkdS(NiR'i(RRRRRR RRRRERRRFR(RRt child1_index((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRjs%)cCs|jtj|jjd|jtj|jjd|jt|jjdt|j |jj|j d|j |jj|j d|j |jjdddS(NiR{iii( RRRRRR R9RkRRRR(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_indexzs "cCs|jj}|jjd|d|j|jj|d|df|jj|j|j|j|jj||jjd|j|j|jj|d|df|jjdd|j|jj||jtj|jjd|d|jtj|jjd|dt j }|jjd||j|jj|dt ||df|jj ||j|jj||jj|j||j|jjt |f||jj ||jtj|jjd||jtj|jjd||jtj|jjdd|jtj|jjdd|jtj|jjdddS(NiiR{ii(RRR}RRRRRRR RRRR (RRR((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs0''## 0&cs|jj|jjgg|jjdfd|jjdfd|j|jjt|j|jj|j|j |j|jjt|j|jj |j dS(Nscs jtS(N(R5R-(RQ(R6(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR7ss<>cs jtS(N(R5R-(RQ(t tab_changed(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR7s( RRRRRRRRRRR9RS(R((R6Rs9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_selects   " " cCs$|jtj|jjd|jtj|jjd|jtj|jjd|jt|jj|jt |j |jj|jddd|j |jj|jdd|jj|jdd|j |jj|jddd|j |jj|jdddS(NitnotabRR]tabc( RRRRRR R9RkRRR(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_tabs%%"%cCsb|jt|jjd|jj|j|jj|j|j|jjddS(Ni((RRFRRRRR(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_tabsscCs|jj|jj|jjdtj|jdd|jj|jjd|j|jjt |j |jj|jjd|j|jjt |j |jj|jjd|j|jjt |j |jj |j dddd|jj |jjtj|jddtjdkrn|jjd n|jjd |j|jjt |j dS( Niis sRR]t underlineRs s(RRRRR tsimulate_mouse_clickt focus_forceRNRRRRRtenable_traversalRR(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_traversals*   " " "  ( R0R1RRRRRRRRRRR(((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs      !   t TreeviewTestcBseZdZdZdZdZdZdZdZdZ dZ d Z e j d d Zd Zd ZdZdZdZRS(cCs#tjtjdd|_dS(NRi(R R R tTreeviewttv(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs cCs|jjtjdS(N(RRR R(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs cCs|jj|j|jjdd|jj|jj|jjdd}|jj}|j||jj|d}|jt |d|jt |t x2|D]*}t |t s|j d|PqqWdg|jd<|jjddd |jj|dd}|jjd dd}|j|d|d||jj|d}|j|jj|ddS( NRR{iisInvalid bounding box: %sttesttcolumnsRi2s#0(RRRRjRRSR}t get_childrenR9RFRkttupleRRtcolumnR (Rtitem_idtchildrenRjRlt bbox_column0t root_widthR((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRms*     cCsD|j|jjd|jjdd}|jt|jjt|j|jjd||jjdd}|jjdd}|jj||||j|jj|||f|jt j |jj|||jj||j|jj|d|jjd|j|jjddS(NRR{i(((( RRRR}R9RkRt set_childrenRRR(RRRR((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_childrens" cCsK|jt|jjdt|jt|jjdddt|jjddd|j|jjddd|j|jjdddd|jt j |jjddd|jt j |jjdidd6id d 6id d 6id d6id d 6g}x-|D]%}|jt j |jjd|qWdS( Ns#0Ri tidtXRs some valuetunknown_optiontwrongtstretchtanchortminwidth( R9RkRRRR RRRRR(Rt invalid_kwsR%((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_column1s"(""$ cCs?|jtj|jjd|jjdd}|jj|d}|j|jj|f|j|jj||f|jj||j|jj|jtj|jj |dd|jjdd}|jjdd}|j|jj||f|jj|||j|jjdS(Ns#0RR{( RRRRRR}RRREtreattach(RRtitem2titem1((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_deleteHs cCs0|jjdd}|jj|d}|jj}|jj|j||jj|j|jj|f|j|jj||f|jj||j|jj|jj|dd|j|jj|f|j|jj||f|jj|dd|j|jj||f|j|jj|d|jt j |jjddd|jt j |jjd|jt j |jj|dd|jt j |jj|dd|jj|||j|jjd|j|jj|ddS( NRR{t nonexistentt otherparentR(((( RR}RtdetachRRERtmoveRRR(RRRtprev((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_detach_reattach`s4     cCst|j|jjdt|j|jjdt|j|jjit|jtj|jjddS(Nt somethingR( RRtexistsRqR-RRRR (R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_existsscCs|j|jjd|jjdd}|jj||j|jj||jj||j|jjd|jtj|jjddS(NRR{R'(RRtfocusR}RRRR(RR((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_focusscCs|jt|jjdt|jjddd|j|jjddd|j|jjdddd|jtj |jjddd|jtj |jjddddS(Ns#0RR't backgroundRi( R9RkRtheadingRRR RRR(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_headings""s+skipping pending resolution of Issue #10734csfd}gjjjjjjddfdjjdddjj|ddsjdngjjj}jjddt jjdddj |jjj|ddsjdndS( Ncs'tjj||jjdS(N(R RRR(RLRM(R(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pytsimulate_heading_clickss#0R4cs jtS(N(R5R-((R6(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR7sRidis>The command associated to the treeview heading wasn't invoked.( RRRRRRSRtmastert _tclCommandsRR R(RRtcommands((RR6s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_heading_callbacks"    . cCs|jtj|jjd|j|jjdd|jjdd}|jjdd}|jj|d}|jj|d}|j|jj|d|j|jj|d|j|jj|d|j|jj|d|jj|dd|j|jj|d|j|jj|d|jj||j|jj|d|jj||j|jj|d|jj ||jtj|jj|dS(NtwhatRiR{i( RRRRRRR}RRR(RRRtc1tc2((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs&cCs|jtj|jjdd|jtj|jjdddd|jtj|jjdddd|j|jj|jjdddt|j|jj|jjdddt|jtj|jjdd|jjddd}|j |d|jtj|jjddd|jtj|jjddt dd}|jjddd |f}|j |jj |d |f|j |jj |d d|f|jj |d t |jj |d d|j |jj |d d|f|jt|jj |t|jj |d d|j|jj |d d|jjddd d d |g}|j |jj |d dd d|f|jj |d g|j|jj |d d|jj |d d|j |jj |d dd|jjddd dd||ff}|j |jj |d ddd||ff|j |jj |jjddddddd|j |jj |jjddd|dd|dS(NRoR{Rtopentpleasetmiddles first-itemuábaRPttagsiiR`Rasa b cs%s %sRs Label here(ii(R`Ra(RRRRR}RERR-RqRRRlR tlistR9RkR(RtitemidRRl((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_insert_itemsN.. "%.%"$+"!!cCsddg|jd<|jjdddddg}|j|jj|idd6dd6|jj|dd|j|jj|ddd dg|jd<|j|jj|idd6|jj|dd|j|jj|d dd|j|jj|ddd |jj|dd |j|jj|dd |j|jj|ddd|j|jj|id d6|jtj|jj|d|jtj|jj|dd|jtj|jjd dS(NtAtBRRR{RPR]RRi{tnotme(R]R](RR](i{R]( RR}RRbRlR RRR(RRl((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR4s"!*"#"""#"c sg|jjddddg}|jjddddg}|jjddfd|jjddfd|jj|jj|jjt}t}xqtd d d D]]}t|d krPn|jj |}|r||kr|j ||j |qqW|j t|d x$|D]}t j |jd |qJW|j td xAtddd ddd D]}|j |dqWdS(NRR{Rtcallscs jdS(Ni(R5(RQ(tevents(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR7Usscs jdS(Ni(R5(RQ(R(s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyR7Wsiidi iii(ii(RR}ttag_bindRRRSRbRRFt identify_rowRRR Rtzip( RRRtpos_ytfoundRRRMRQ((Rs9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyt test_tag_bindPs2       0cCs|jt|jj|jtj|jjddd|jjddd|jt|jjddd|jt|jjdddd|j t |jjdt dS(NRtskytbluet foreground( Rt TypeErrorRt tag_configureRRRRR R9RkR(R((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyttest_tag_configurers !(R0R1RRRmRRRRRRRtunittesttskipR RRRR!R'(((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyRs        *  #  =  "t__main__(R(RR ttest.test_supportRRRR ttest_functionsRRtTestCaseRR3R<RIRfRRRRRt tests_guiR0(((s9/usr/lib64/python2.7/lib-tk/test/test_ttk/test_widgets.pyts.      ? bhwL