ϪfdZddlmZmZmZmZGddZGddeeZGddeeZGd d Z Gd d e eZ Gd de eZ GddZ Gdde eZ Gdde eZGddZGddeeZGddeeZGddZGddeeZGdd eeZGd!d"ZGd#d$eeZGd%d&eeZGd'd(ZGd)d*eeZGd+d,eeZGd-d.ZGd/d0eeZGd1d2eeZGd3d4ZGd5d6eeZGd7d8eeZ Gd9d:Z!Gd;de!eZ#Gd?d@eZ$yA)Ba$ Definitions of test cases with various interesting behaviors, to be used by L{twisted.trial.test.test_tests} and other test modules to exercise different features of trial's test runner. See the L{twisted.trial.test.test_tests} module docstring for details about how this code is arranged. )FailTestSkipTestSynchronousTestCaseTestCasec:eZdZdZdZde_dZde_y) SkippingMixinctdNskip1rselfs =/usr/lib/python3/dist-packages/twisted/trial/test/skipping.py test_skip1zSkippingMixin.test_skip1 wctd)NzI should not get raised RuntimeErrorr s r test_skip2zSkippingMixin.test_skip2s455rskip2c&|jdy)NzI should not failfailr s r test_skip3zSkippingMixin.test_skip3s %&rskip3N)__name__ __module__ __qualname__rrskiprrrrrs# 6JO'JOrrc eZdZy)SynchronousSkippingNrrrr!rrr#r#!rr#c eZdZy)AsynchronousSkippingNr$r!rrr'r'%r%rr'ceZdZdZdZdZy)SkippingSetUpMixinctd)N skipSetUpr r s rsetUpzSkippingSetUpMixin.setUp*s {##rcyNr!r s rtest_1zSkippingSetUpMixin.test_1- rcyr.r!r s rtest_2zSkippingSetUpMixin.test_20r0rN)rrrr,r/r2r!rrr)r))s$  rr)c eZdZy)SynchronousSkippingSetUpNr$r!rrr4r44r%rr4c eZdZy)AsynchronousSkippingSetUpNr$r!rrr6r68r%rr6ceZdZdZy)DeprecatedReasonlessSkipMixinctr.r r s rr/z$DeprecatedReasonlessSkipMixin.test_1=s jrN)rrrr/r!rrr8r8<srr8c eZdZy)#SynchronousDeprecatedReasonlessSkipNr$r!rrr;r;As rr;c eZdZy)$AsynchronousDeprecatedReasonlessSkipNr$r!rrr=r=Gr%rr=c<eZdZdZdZdZdZde_dZdZy) SkippedClassMixinclassc&d|j_y)NT) __class__ _setUpRanr s rr,zSkippedClassMixin.setUpNs#' rctdr r r s rrzSkippedClassMixin.test_skip1Qrrctd)NzOught to skip merr s rrzSkippedClassMixin.test_skip2T-..rrcyr.r!r s rrzSkippedClassMixin.test_skip3Yr0rctd)Nz Skip me toorr s r test_skip4zSkippedClassMixin.test_skip4\s =))rN) rrrr r,rrrrIr!rrr?r?Ks) D( /JO *rr?c eZdZy)SynchronousSkippedClassNr$r!rrrKrK`r%rrKc eZdZy)AsynchronousSkippedClassNr$r!rrrMrMdr%rrMcHeZdZdZde_dZde_dZde_y) TodoMixinc&|jdyNzdeliberate failurerr s r test_todo1zTodoMixin.test_todo1i &'rtodo1ctdNzdeliberate errorrr s r test_todo2zTodoMixin.test_todo2nrFrtodo2cy)zunexpected successNr!r s r test_todo3zTodoMixin.test_todo3ssrtodo3N)rrrrRtodorWrZr!rrrOrOhs,(JO/JO!JOrrOc eZdZy)SynchronousTodoNr$r!rrr^r^yr%rr^c eZdZy)AsynchronousTodoNr$r!rrr`r`}r%rr`c&eZdZdZdZde_y)SetUpTodoMixinctdrVrr s rr,zSetUpTodoMixin.setUprFrcyr.r!r s rrRzSetUpTodoMixin.test_todo1r0rz setUp todo1N)rrrr,rRr\r!rrrbrbs/ $JOrrbc eZdZy)SynchronousSetUpTodoNr$r!rrrfrfr%rrfc eZdZy)AsynchronousSetUpTodoNr$r!rrrhrhr%rrhc&eZdZdZdZde_y)TearDownTodoMixinctdrVrr s rtearDownzTearDownTodoMixin.tearDownrFrcyr.r!r s rrRzTearDownTodoMixin.test_todo1r0rztearDown todo1N)rrrrlrRr\r!rrrjrjs/ 'JOrrjc eZdZy)SynchronousTearDownTodoNr$r!rrroror%rroc eZdZy)AsynchronousTearDownTodoNr$r!rrrqrqr%rrqcDeZdZdZdZde_dZdZde_dZy)TodoClassMixinr@cyr.r!r s rrRzTodoClassMixin.test_todo1r0rmethodcyr.r!r s rrWzTodoClassMixin.test_todo2r0rc&|jdyNzDeliberate Failurerr s rrZzTodoClassMixin.test_todo3rSrc&|jdyrxrr s r test_todo4zTodoClassMixin.test_todo4rSrN)rrrr\rRrWrZrzr!rrrsrss- D JO (JO(rrsc eZdZy)SynchronousTodoClassNr$r!rrr|r|r%rr|c eZdZy)AsynchronousTodoClassNr$r!rrr~r~r%rr~ceZdZdZedfe_dZeefdfe_dZedfe_dZ ee fdfe _d Z e d fe _d Z ed fe _d Zedfe_y)StrictTodoMixinctdNzexpected failurerr s rrRzStrictTodoMixin.test_todo1rFrrTctdrrr s rrWzStrictTodoMixin.test_todo2rFrrXctdNzwe had no idea!rr s rrZzStrictTodoMixin.test_todo3,--rr[ctdrrr s rrzzStrictTodoMixin.test_todo4rrtodo4c&|jdyrQrr s r test_todo5zStrictTodoMixin.test_todo5rSrtodo5c&|jdyrQrr s r test_todo6zStrictTodoMixin.test_todo6rSrtodo6cyr.r!r s r test_todo7zStrictTodoMixin.test_todo7r0rtodo7N)rrrrRrr\rWOSErrorrZrz SyntaxErrorrrrrr!rrrrs/$W-JO/%g.8JO.(JO. -w7JO( )JO($W-JO $W-JOrrc eZdZy)SynchronousStrictTodoNr$r!rrrrr%rrc eZdZy)AsynchronousStrictTodoNr$r!rrrrr%rrc0eZdZdZdZdZdZdZdZy)AddCleanupMixincdg|_y)Nr,)logr s rr,zAddCleanupMixin.setUps 9rc(dg|_td)Nr,zDeliberate failure)rrr s r brokenSetUpzAddCleanupMixin.brokenSetUps9/00rc(dg|_td)Nr,z Don't do this)rrr s r skippingSetUpzAddCleanupMixin.skippingSetUps9''rc:|jj|yr.rappend)rthings rrzAddCleanupMixin.appends rc:|jjdy)Nrlrr s rrlzAddCleanupMixin.tearDowns  #rc:|jjdy)NrunTestrr s rrzAddCleanupMixin.runTests  "rN) rrrr,rrrrlrr!rrrrs 1($#rrc eZdZy)SynchronousAddCleanupNr$r!rrrrr%rrc eZdZy)AsynchronousAddCleanupNr$r!rrrrr%rrc&eZdZdZddZde_y)ExpectedFailurezp Hold a test that has an expected failure with an exception that has a large string representation. Nctddz)z' Fail, but expectedly. xirr s r"test_expectedFailureGreaterThan64kz2ExpectedFailure.test_expectedFailureGreaterThan64ks3),--rzshort todo string)returnN)rrr__doc__rr\r!rrrr s . /B&+rrN)%rtwisted.trial.unittestrrrrrr#r'r)r4r6r8r;r=r?rKrMrOr^r`rbrfrhrjrorqrsr|r~rrrrrrrr!rrrs UT   -)<  =(    13F  2H   !#6  +H( *** /1D  0( " i!4  y( $$ >+>  NH '' /1D  0( ((( >+>  NH ".".J O-@  _h ##, O-@  _h  B) Br