a 4êdg/ã@svdZddlZddlZddlZddlmZeedƒr)óz(AuditTest.run_python..r ) r rrrrrrr rrr r)rrÚeventsrrrrÚ run_pythonsü ýzAuditTest.run_pythoncCs| d¡dS)NÚ test_basic©r©rrrrr'-szAuditTest.test_basiccCs| d¡dS)NÚtest_block_add_hookr(r)rrrr*0szAuditTest.test_block_add_hookcCs| d¡dS)NÚ!test_block_add_hook_baseexceptionr(r)rrrr+3sz+AuditTest.test_block_add_hook_baseexceptioncCst d¡| d¡dS)NÚpickleÚ test_pickle)rÚ import_modulerr)rrrr-6s zAuditTest.test_picklecCs| d¡dS)NÚtest_monkeypatchr(r)rrrr/;szAuditTest.test_monkeypatchcCs| dtj¡dS)NÚ test_open)rrZTESTFNr)rrrr0>szAuditTest.test_opencCs| d¡dS)NÚ test_cantracer(r)rrrr1AszAuditTest.test_cantracecCs| d¡dS)NÚ test_mmapr(r)rrrr2DszAuditTest.test_mmapcCs6| d¡\}}}|s$| d|›¡| dg|¡dS)NÚtest_excepthookzExpected fatal exception )zsys.excepthookrzRuntimeError('fatal-error'))r&rÚassertSequenceEqual©rrr%r rrrr3Gs ÿzAuditTest.test_excepthookcCsJ| d¡\}}}|r| |¡| |ddd¡| |ddd¡dS)NÚtest_unraisablehookrzsys.unraisablehookézDRuntimeError('nonfatal-error') Exception ignored for audit hook test)r&rÚ assertEqualr5rrrr6Ps  þzAuditTest.test_unraisablehookcCs¸t d¡| d¡\}}}|r(| |¡| |ddd¡| |ddd¡|dd}| |¡| dd |›d g|d¡| dd |›d g|d ¡| d d |g|d¡dS)NÚwinregÚ test_winregrzwinreg.OpenKeyézwinreg.OpenKey/resultr7zwinreg.EnumKeyrz 0z 10000ézwinreg.PyHKEY.Detaché)rr.r&rr8Ú assertTruer4)rrr%r Zexpectedrrrr:[s    zAuditTest.test_winregcCs”t d¡| d¡\}}}|r(| |¡tjrÚendswithr5rrrr@is  zAuditTest.test_socketcCsP| d¡\}}}|r| |¡tjr2t|ddiŽ| dd„|Dƒgd¢¡dS)NÚtest_gcrArBcSsg|] }|d‘qS)rr)r!Úeventrrrr#~r$z%AuditTest.test_gc..)zgc.get_objectszgc.get_referrerszgc.get_referents)r&rrrCrDr8r5rrrrFvs  þzAuditTest.test_gcN)Ú__name__Ú __module__Ú __qualname__rr&r'r*r+r-r/r0r1r2r3r6r:r@rFrrrrrs    rÚ__main__)Ú__doc__r rZunittestÚtestrÚhasattrZSkipTestZfindfilerZTestCaserrHÚmainrrrrÚs   t