Your IP : 172.28.240.42


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

ó
ˆ5„Oc@suddlZddlZddlZddlZddlZd„Zd„Zdejfd„ƒYZ	ej
ƒdS(iÿÿÿÿNcCstj|ƒdS(sTest thread to just wait a bit.N(ttimetsleep(tseconds((s,/usr/share/apport/testsuite/test_rethread.pytidlescCs||S(s"Test thread to divide two numbers.((txty((s,/usr/share/apport/testsuite/test_rethread.pytdiv
stTcBs,eZd„Zd„Zd„Zd„ZRS(cCsitjjdtddƒ}|jƒ|jƒ|jƒ|j|jƒdƒ|j|jƒdƒdS(sreturn value works properly.ttargettargsi*iiN(i*i(
tapporttREThreadRtstarttjoint	exc_raisetassertEqualtreturn_valuetexc_infotNone(tselftt((s,/usr/share/apport/testsuite/test_rethread.pyttest_return_values


cCsrtjjdtddƒ}|jƒ|jt|jƒ|jƒ|j|jƒdƒ|j|j
ƒdƒdS(sAapport.REThread.REThread works if run() does not return anything.RR	gà?N(gà?(R
RRRtassertRaisestAssertionErrorRR
RRR(RR((s,/usr/share/apport/testsuite/test_rethread.pyttest_no_return_values

cCs×tjjdtddƒ}|jƒ|jƒ|jt|jƒ|j|j	ƒdt
kƒtj|j	ƒd|j	ƒd|j	ƒdƒ}|j|dj
dƒdt|ƒƒ|j|d	jd
ƒƒdS(
s)exception in thread is caught and passed.RR	iiiiÿÿÿÿtZeroDivisionErrorsnot a ZeroDivisionError:iþÿÿÿs
return x / y
N(ii(R
RRRR
RRRt
assertTrueRRt	tracebacktformat_exceptiont
startswithtstrtendswith(RRtexc((s,/usr/share/apport/testsuite/test_rethread.pyttest_exception&s

 'cCsåtjjdtddƒ}|jƒ|jƒ|jt|jƒt}y|j	ƒWn{t
}tjƒ}t
j|d|d|dƒ}|j|djdƒdt|ƒƒ|j|d	jd
ƒƒnX|j|ƒdS(
s+exc_raise() raises caught thread exception.RR	iiiiÿÿÿÿRsnot a ZeroDivisionError:iþÿÿÿs
return x / y
N(ii(R
RRRR
RRRtFalseRtTruetsysRRRRRRR(RRtraisedteR ((s,/usr/share/apport/testsuite/test_rethread.pyttest_exc_raise4s

!'(t__name__t
__module__RRR!R'(((s,/usr/share/apport/testsuite/test_rethread.pyRs			(tunittestRRR$tapport.REThreadR
RRtTestCaseRtmain(((s,/usr/share/apport/testsuite/test_rethread.pyt<module>s
0		8