ó ‰P[c@sjdZddlZddlZddlZddlZddlZddlZddlZddlZddl m Z m Z ddlm Z ddlmZddlZe je jje jjBƒejjdƒrædZdZnHejjejjd d ƒd ƒZejjejjd d ƒd ƒZejd eƒjZdejfd„ƒYZejƒdS(s GTK Apport user interface tests.iÿÿÿÿN(tGLibtGtk(tunicode_gettext(tpatchtAPPORT_TEST_LOCALsgtk/apport-gtksdata/kernel_oopstAPPORT_DATA_DIRs/usr/share/apports apport-gtkt kernel_oopsttTcBsNeZed„ƒZd„Zd„Zd„Zd„Zd„Zd„Z d„Z d„Z d „Z d „Z d „Zd „Zejed ƒd„ƒZd„Zd„Zd„Zd„Zejedƒejedƒejedƒd„ƒƒƒZejedƒejedƒejedƒd„ƒƒƒZejedƒejedƒejedƒd„ƒƒƒZejedƒd„ƒZejedƒd„ƒZd„Zd„Zejedƒd„ƒZejedƒd„ƒZ ejedƒd „ƒZ!d!„Z"d"„Z#d#„Z$ejedƒd$„ƒZ%RS(%cCs1tjƒ}|jƒ|djƒd|_dS(Nt DistroReleasei(tapporttReportt add_os_infotsplittdistro(tklasstr((s*/usr/share/apport/testsuite/test_ui_gtk.pyt setUpClass's  cCsatjƒ|_|jtj_|jtjdtresult((R3s*/usr/share/apport/testsuite/test_ui_gtk.pyttest_close_buttonSs  cCs•d|jjd ApportVersion | | | | ... | | | +----------------------------------------------------+ | | | | [ Cancel ] [ Send ] | +-------------------------------------------------------------------+ RIs&Send problem report to the developers?RORJR?RKRLtSendRNt cancel_buttontdetails_scrolledwindowR:N(R(R$R,RRBRRQRCRARRR;RTRURDRWRVRXRYt get_resizable(R3R?((s*/usr/share/apport/testsuite/test_ui_gtk.pyttest_apport_bug_package_layout¨s"  """ """cCsÛd|j_tjdƒ|j_d|jjdõstbashiRHR~RR[sbash R’RN( R(R$R,R¬tpackageRR”trun_report_bugRRR-RVR˜R(R3R>((R3s*/usr/share/apport/testsuite/test_ui_gtk.pyt!test_bug_report_installed_packageòs   cs¸‡fd†}tjjƒ}dˆj_|ˆjj_tj d|ƒˆjj ƒˆj ˆjj ddƒˆj ˆjj dtjj |ƒƒˆj ˆjj dd|ƒdS( s"Bug report for uninstalled packagecs6ˆjjdƒjƒstSˆjjdƒjƒtS(NRz(R$R;R‹RARwRu(R=(R3(s*/usr/share/apport/testsuite/test_ui_gtk.pyR>siRHR~RR[s%s (not installed)N(R t packagingtget_uninstalled_packageR(R$R,R¬R½RR”R¾RRR-t get_source(R3R>tpkg((R3s*/usr/share/apport/testsuite/test_ui_gtk.pyt#test_bug_report_uninstalled_packages  cs d ˆj_‡fd†}ˆjjjiƒ}ˆj|dƒdˆjj_dˆjj_t j d|ƒˆjj ƒˆjˆjjj ƒdƒˆjjj dƒ}ˆj|djdƒƒˆjd|dkƒˆjd |kƒˆjˆjjjdƒd S( sUpdating an existing reportcs6ˆjjjƒdkrtSˆjjdƒjƒtS(NRL(R$R›RœR(RAR;RwRu(R=(R3(s*/usr/share/apport/testsuite/test_ui_gtk.pyRŽsiR¼iÈR[sbash R‘R’R N(R(R$R,R)tuploadRRR¬t update_reportR½RRŒtrun_update_reportR–R—RVR˜RˆR™(R3R=RŽtidR((R3s*/usr/share/apport/testsuite/test_ui_gtk.pyttest_update_reports  csÁdˆj_‡fd†}tjjƒ}tjj|ƒ}ˆj||dƒˆjtjj|ƒdd|ƒˆj t tjj|ƒt t j jˆjd|ƒdƒ}|jdƒWdQXˆjjjiƒ}ˆj|d ƒd ˆjj_|ˆjj_tjd |ƒˆjjƒˆjˆjjjƒd ƒˆjjjd ƒ}ˆjd |kƒˆjd |kƒˆjd |kƒˆj|ddƒˆjˆjjjd ƒdS(s]Updating an existing report on a source package which does not have a binary of the same namecs6ˆjjjƒdkrtSˆjjdƒjƒtS(NRL(R$R›RœR(RAR;RwRu(R=(R3(s*/usr/share/apport/testsuite/test_ui_gtk.pyRŽ@ssIthis test assumes that the kernel binary package != kernel source packageRs@this test assumes that the kernel binary package %s is installeds source_%s.pyR;s0def add_info(r, ui): r["MachineType"]="Laptop" NiiÈRpR tUnamet MachineTypetLaptop(R(R$R,R RÀtget_kernel_packageRÂRt get_versiont assertRaisest ValueErrorR.RR*R+R0R/R)RÅRRR¬RÆR½RRŒRÇR–R—RVRˆR™(R3R=RŽt kernel_pkgt kernel_srcR5RÈR((R3s*/usr/share/apport/testsuite/test_ui_gtk.pyt*test_update_report_different_binary_source:s0   ( tget_desktop_entrycGsad|jjds0          $$ÿÿÿ¶