Your IP : 172.28.240.42


Current Path : /usr/share/apport/testsuite/
Upload File :
Current File : //usr/share/apport/testsuite/test_ui_kde.pyc


Yc@sdZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
mZddlm
Z
ddlmZmZmZmZddlmZddlZddlmZddlZejjd	rd
Zn$ejjejjddd
ZejdejZeej d<dej!fdYZ"d
Z#dZ$edZ%dZ&edZ'ej(Z)edZ*eZ+dZ,dZ-ee#e$e%e&e'e)e*e+e,e-
Z.ej/dge.eZ0ej1dS(s!KDE 4 Apport User Interface testsiN(tpatch(tQTimertQCoreApplication(tQTreeWidget(tki18ntKCmdLineArgst
KAboutDatatKLocalizedString(tKApplication(tunicode_gettexttAPPORT_TEST_LOCALskde/apport-kdetAPPORT_DATA_DIRs/usr/share/apports
apport-kdetitTcBseZedZdZdZdZdZdZdZ	dZ
dZd	Zd
Z
ejeddZejedd
ZejeddZdZdZejeddZejeddZdZRS(cCs'tj}|j|d|_dS(Nt
DistroRelease(tapporttReporttadd_os_infotdistro(tklasstr((s*/usr/share/apport/testsuite/test_ui_kde.pyt
setUpClass&s
cCs
tj|_|jtj_t|_tjjj	di|j_tj|_|jtj
_|jtj
_tjj|jd|j_tj|j_
d|jj
d<d|jj
d<d|jj
d<t|jjd}|jj
j|WdQXdS(	Ns
bash.crashs	/bin/bashtExecutablePatht11tSignalRtCoreDumptw(ttempfiletmkdtempt
report_dirRt	fileutilstMainUserInterfacetapptcrashdb_impltmemoryt
CrashDatabasetNonetcrashdbthook_dirtreportt	_hook_dirt_common_hook_dirtostpathtjointreport_fileRtopentwrite(tselftf((s*/usr/share/apport/testsuite/test_ui_kde.pytsetUp,scCsZ|jjr6tj|jjjdtjntj|jtj|jdS(Ni(	R tdialogRt
processEventstdonetshutiltrmtreeRR&(R0((s*/usr/share/apport/testsuite/test_ui_kde.pyttearDownEs

csFfd}tjd|jjt}j|ddS(sBClicking the close button on the window does not report the crash.csjjjdS(N(R R3treject(targs(R0(s*/usr/share/apport/testsuite/test_ui_kde.pytcQsiR'N(Rt
singleShotR tui_present_report_detailstTruetassertFalse(R0R;tresult((R0s*/usr/share/apport/testsuite/test_ui_kde.pyttest_close_buttonNscCsYd|jjd<tjdtj|jjt|j|jj	j
|jjd|j|jj	j
jtd|j|j|jj	jj|j|jj	jj|j|jj	jj|j|jj	jj|j|jj	jjtd|j|jj	jj|j|jj	jjdS(s
        +-----------------------------------------------------------------+
        | [ logo ] YourDistro has experienced an internal error.          |
        |                                                                 |
        |            [x] Send an error report to help fix this problem.   |
        |                                                                 |
        | [ Show Details ]                                   [ Continue ] |
        +-----------------------------------------------------------------+
        tKernelCrashtProblemTypeis,Sorry, %s has experienced an internal error.tContinueN(R R'RR<RtquitR=R>tassertEqualR3twindowTitleRtsplittheadingttextt_t
assertTruetsend_error_reportt	isVisiblet	isCheckedtdetailstcontinue_buttonR?t
closed_button(R0((s*/usr/share/apport/testsuite/test_ui_kde.pyttest_kernel_crash_layoutWs
%cCskd|jjd<d|jjd<tjdtj|jjt|j|jj	j
|jjd|j|jj	j
jtd|j|jj	jj|j|jj	jj|j|jj	jj|j|jj	jj|j|jj	jjtd|j|jj	jj|j|jj	jjtddS(	si
        +-----------------------------------------------------------------+
        | [ error  ] Sorry, a problem occurred while installing software. |
        |            Package: apport 1.2.3~0ubuntu1                       |
        |                                                                 |
        |            [x] Send an error report to help fix this problem.   |
        |                                                                 |
        | [ Show Details ]                                   [ Continue ] |
        +-----------------------------------------------------------------+
        tPackageRCsapport 1.2.3~0ubuntu1is4Sorry, a problem occurred while installing software.RDsPackage: apport 1.2.3~0ubuntu1N(R R'RR<RRER=R>RFR3RGRRHRIRJRKRLRMRNRORPRQR?RR(R0((s*/usr/share/apport/testsuite/test_ui_kde.pyttest_package_crash_layoutps 
%cCsd|jjd<d|jjd<d|jjd<tjT}|jd|j|j|jjd<tjd	t	j
|jjtWd
QX|j
|jjj|jjd	|j
|jjjjtd|j|jjjj|j|jjjj|j|jjjj|j|jjjj|j
|jjjjtd|j|jjjj|j|jjjj|j|jjjj|j|jjjj|jt|jjjjjd
d
S(si
        +-----------------------------------------------------------------+
        | [ apport ] The application Apport has closed unexpectedly.      |
        |                                                                 |
        |            [x] Send an error report to help fix this problem.   |
        |            [ ] Ignore future problems of this program version.  |
        |                                                                 |
        | [ Show Details ]                                   [ Continue ] |
        +-----------------------------------------------------------------+
        tCrashRCt1tCrashCountersapport 1.2.3~0ubuntu1RTs8[Desktop Entry]
Version=1.0
Name=Apport
Type=ApplicationtDesktopFileiNs/The application Apport has closed unexpectedly.RDsof this program version( R R'RtNamedTemporaryFileR/tflushtnameRR<RRER=R>RFR3RGRRHRIRJRKRLRMRNRORPRQR?RRtignore_future_problemststrtendswith(R0tfp((s*/usr/share/apport/testsuite/test_ui_kde.pyttest_regular_crash_layouts2

%!cCs0t|j_d|jjd<d|jjd<d|jjd<d|jjd<tjT}|jd	|j|j|jjd
<t	j
dtj|jj
tWdQX|j|jjj|jjd|j|jjjjtd
|j|jjjj|j|jjjj|j|jjjj|j|jjjj|j|jjjjtd|j|jjjj|j|jjjj|j|jjjj|j|jjjj|jt|jjjjj ddS(si
        +-----------------------------------------------------------------+
        | [ apport ] The application Apport has closed unexpectedly.      |
        |                                                                 |
        |            [x] Send an error report to help fix this problem.   |
        |            [ ] Ignore future problems of this program version.  |
        |                                                                 |
        | [ Show Details ]                 [ Leave Closed ]  [ Relaunch ] |
        +-----------------------------------------------------------------+
        RVRCRWRXsapport-bug apporttProcCmdlinesapport 1.2.3~0ubuntu1RTs8[Desktop Entry]
Version=1.0
Name=Apport
Type=ApplicationRYiNs/The application Apport has closed unexpectedly.tRelaunchsof this program version(!R>R t
offer_restartR'RRZR/R[R\RR<RRER=RFR3RGRRHRIRJRKRLRMRNRORPRQRRR?R]R^R_(R0R`((s*/usr/share/apport/testsuite/test_ui_kde.pyt!test_regular_crash_layout_restarts6

%!cCs|d|jjd<d|jjd<d|jjd<d|jjd<tjT}|jd	|j|j|jjd
<tjdt	j
|jjtWdQX|j
|jjjjtd
|j|jjjj|j|jjjj|j|jjjj|j|jjjj|j
|jjjjtd|j|jjjjdS(si
        +-----------------------------------------------------------------+
        | [ apport ] The application Apport has closed unexpectedly.      |
        |                                                                 |
        |            [x] Send an error report to help fix this problem.   |
        |            [ ] Ignore future problems of this program version.  |
        |                                                                 |
        | [ Show Details ]                                   [ Continue ] |
        +-----------------------------------------------------------------+
        RVRCRWRXsapport-bug apportRbsapport 1.2.3~0ubuntu1RTs8[Desktop Entry]
Version=1.0
Name=Apport
Type=ApplicationRYiNs/The application Apport has closed unexpectedly.RD(R R'RRZR/R[R\RR<RRER=R>RFR3RIRJRKRLRMRNRORPRQR?RR(R0R`((s*/usr/share/apport/testsuite/test_ui_kde.pyt#test_regular_crash_layout_norestarts&

%cCsd|jjd<d|jjd<d|jjd<tjdtj|jjt|j|jj	j
|jjd|j|jj	j
jtd|j|j|jj	jjtd	|j|jj	jj|j|jj	jj|j|jj	jj|j|jj	jj|j|jj	jj|j|jj	jjtd
|j|jj	jj|j|jj	jj|jt|jj	jjjddS(
s
        +-----------------------------------------------------------------+
        | [ logo ] Sorry, YourDistro has experienced an internal error.   |
        |            If you notice further problems, try restarting the   |
        |            computer                                             |
        |                                                                 |
        |            [x] Send an error report to help fix this problem.   |
        |            [ ] Ignore future problems of this type.             |
        |                                                                 |
        | [ Show Details ]                                   [ Continue ] |
        +-----------------------------------------------------------------+
        RVRCRWRXsapport 1.2.3~0ubuntu1RTis,Sorry, %s has experienced an internal error.s<If you notice further problems, try restarting the computer.RDsof this typeN(R R'RR<RRER=R>RFR3RGRRHRIRJRKRLRNRMRORPRQR?RRR]R^R_(R0((s*/usr/share/apport/testsuite/test_ui_kde.pyttest_system_crash_layouts*

%!cCsd|j_tjdtj|jjt|j	|jj
j|jj
d|j	|jj
jjtd|j|jj
jj|j|jj
jj|j|jj
jj|j|jj
jj|j|jj
jj|j	|jj
jjtd|j|jj
jj|j|jj
jj|j|jj
jjdS(s
        +-------------------------------------------------------------------+
        | [ error  ] Send problem report to the developers?                 |
        |                                                                   |
        |            +----------------------------------------------------+ |
        |            | |> ApportVersion                                   | |
        |            | ...                                                | |
        |            +----------------------------------------------------+ |
        |                                                                   |
        | [ Cancel ]                                               [ Send ] |
        +-------------------------------------------------------------------+
        is&Send problem report to the developers?tSendN(R$R R-RR<RRER=R>RFR3RGRRHRIRJRKR?RNRMRLRORPRQRRt
cancel_buttonttreeview(R0((s*/usr/share/apport/testsuite/test_ui_kde.pyttest_apport_bug_package_layout#s 

%topen_urlcs d_fdfdtjdjjjjjjjj	djjj
d}j|ddj|ddjjtj|d	j
d
jd|dkjd
|kjjjjddS(s$Crash report without showing detailscs\jjrHjjjjrHjjjjtjddStjddS(Nii(R R3RQRNtclickRR<(R:(tcontR0tcheck_progress(s*/usr/share/apport/testsuite/test_ui_kde.pyRnGs
!csjjdk_dS(N(R tprogressR$tvisible_progress(R:(R0(s*/usr/share/apport/testsuite/test_ui_kde.pyRoOsiiRCRVRs	/bin/bashRTsbash tlibctDependenciest
StacktraceiN(R$RqRR<R t	run_crashR-RFR%t	latest_idtdownloadR>RLt
startswithRlt
call_count(R0R:R((RnR0Ros*/usr/share/apport/testsuite/test_ui_kde.pyttest_1_crash_nodetailsAs	cs5d_fdfdfdtjdjjjjjjjj	djjj
d}j|ddj|dd	jjtj|d
j
djd|d
kjd|kjjjjddS(s!Crash report with showing detailscs\jjrHjjjjrHjjjjtjddStjddS(Nii(R R3tshow_detailsRNRmRR<(R:(R{R0Rn(s*/usr/share/apport/testsuite/test_ui_kde.pyR{ls
!csjjjtd}|jdkr>tjddSjjrjjjjrjjjj	tjddStjddS(NRPiii(
R R3t	findChildRttopLevelItemCountRR<RQRNRm(R:RP(RnR0Ro(s*/usr/share/apport/testsuite/test_ui_kde.pyRnus!csjjdk_dS(N(R RpR$Rq(R:(R0(s*/usr/share/apport/testsuite/test_ui_kde.pyRosiiRCRVRs	/bin/bashRTsbash RrRsRtiN(R$RqRR<R RuR-RFR%RvRwtFalseRLRxRlRy(R0R:R((RnR0R{Ros*/usr/share/apport/testsuite/test_ui_kde.pyttest_1_crash_detailsfs		cs-d_fdfdtjddgjjjd<jjjjj	jjj
dj	jjjdj	jt
jj}j	|dd	j	|d
dj|djd
jd|dkjd|kdS(s(Crash report with non-accepting crash DBcs\jjrHjjjjrHjjjjtjddStjddS(Nii(R R3RQRNRmRR<(R:(RnR0Ro(s*/usr/share/apport/testsuite/test_ui_kde.pyRns
!csjjdk_dS(N(R RpR$Rq(R:(R0(s*/usr/share/apport/testsuite/test_ui_kde.pyRositbugt
problem_typesiiRCRVRs	/bin/bashRTsbash RrRsRtN(R$RqRR<R R%toptionsRuR-RFRvRlRyR~R'RLRx(R0R:R((RnR0Ros*/usr/share/apport/testsuite/test_ui_kde.pyttest_1_crash_noaccepts	csdj_djj_fdtjdjjjjj	ddjjj	ddj
jj	djdjjj	d	d
dS(s Bug report for installed packagetbashcsLjjr8jjjjr8jjjjdStjddS(Ni(R R3RiRNRmRR<(R:(R0R;(s*/usr/share/apport/testsuite/test_ui_kde.pyR;s!iRCtBugt
SourcePackageRTsbash RsRN(
R$R R-RtpackageRR<trun_report_bugRFR'RLRxtassertNotEqual(R0((R;R0s*/usr/share/apport/testsuite/test_ui_kde.pyt!test_bug_report_installed_packages
 cstjj}dj_|jj_fdtj	djj
jjjddjjjdtjj
|jjjdd|dS(	s"Bug report for uninstalled packagecsLjjr8jjjjr8jjjjdStjddS(Ni(R R3RiRNRmRR<(R:(R0R;(s*/usr/share/apport/testsuite/test_ui_kde.pyR;s!iRCRRRTs%s (not installed)N(Rt	packagingtget_uninstalled_packageR$R R-RRRR<RRFR't
get_source(R0tpkg((R;R0s*/usr/share/apport/testsuite/test_ui_kde.pyt#test_bug_report_uninstalled_packages
csd
j_fdjjji}j|ddjj_djj_t	j
djjjjjjdjjj
d}j|djdjd|dkjd	|kjjjjdd
S(sUpdating an existing reportcsLjjr8jjjjr8jjjjdStjddS(Ni(R R3RQRNRmRR<(R:(R0Rn(s*/usr/share/apport/testsuite/test_ui_kde.pyRns!iRiRTsbash RrRsRN(R$R R-R%tuploadRFRt
update_reportRRR<trun_update_reportRvRwRLRxRlRy(R0R:tidR((RnR0s*/usr/share/apport/testsuite/test_ui_kde.pyttest_1_update_reports
csdj_fdtjj}tjj|}j||djtjj|dd|j	t
tjj|ttj
jjd|d}|jdWdQXjjji}j|d	d	jj_|jj_tjd
jjjjjjd	jjjd	}jd|kjd|kjd
|kj|ddjjjjd	dS(s]Updating an existing report on a source package which does not have a binary of the same namecsLjjr8jjjjr8jjjjdStjddS(Ni(R R3RQRNRmRR<(R:(R0Rn(s*/usr/share/apport/testsuite/test_ui_kde.pyRns!sIthis test assumes that the kernel binary package != kernel source packageRs@this test assumes that the kernel binary package %s is installedssource_%s.pyRs0def add_info(r, ui):
 r["MachineType"]="Laptop"
NiitProcEnvironRtUnametMachineTypetLaptop(R$R R-RRtget_kernel_packageRRtget_versiontassertRaisest
ValueErrorR.R*R+R,R&R/R%RRFRRRRR<RRvRwRLRlRy(R0R:t
kernel_pkgt
kernel_srcR1RR((RnR0s*/usr/share/apport/testsuite/test_ui_kde.pyt,test_1_update_report_different_binary_sources0(
cCs_tjdtj|jjt|j|jjj	j
|j|jjj	jdS(Ni(RR<RRER R=R~R?R3RMRNRO(R0((s*/usr/share/apport/testsuite/test_ui_kde.pyt%test_administrator_disabled_reporting?s(t__name__t
__module__tclassmethodRR2R8RARSRURaReRfRgRkRtobjectRRzRRRRRRR(((s*/usr/share/apport/testsuite/test_ui_kde.pyR
%s&								(	*	"	#	%4$		"3Rs
Apport KDEs1.0s#KDE 4 frontend tests for the apports2012 Canonical Ltd.s/https://wiki.ubuntu.com/AutomatedProblemReportsskubuntu-devel@lists.ubuntu.com(2t__doc__timptunittestRtsysR*R6tmockRtPyQt4.QtCoreRRtPyQt4.QtGuiRtPyKDE4.kdecoreRRRRtPyKDE4.kdeuiRRR	RKtapport.crashdb_impl.memorytenvirontgettapport_kde_pathR+R,tload_sourceRtargvtTestCaseR
tappNametcatalogtprogramNametversiontdescriptiontLicense_GPLtlicenset	copyrightRJthomePagetbugEmailt	aboutDatatinitR tmain(((s*/usr/share/apport/testsuite/test_ui_kde.pyt<module>sJ
"	$
"