Current Path : /usr/share/apport/testsuite/ |
Current File : //usr/share/apport/testsuite/test_python_crashes.pyc |
Yc @ s d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z d d l Z e j Z e e j d <e j e j e d d l Z d d l Z d e j f d YZ e j d S( iNt APPORT_REPORT_DIRt Tc B sh e Z d Z d d d Z d Z d Z d Z d Z d Z d Z d Z d Z RS( c C s+ x$ t j j D] } t j | q Wd S( N( t apportt fileutilst get_all_reportst ost unlink( t selft f( ( s2 /usr/share/apport/testsuite/test_python_crashes.pyt tearDown s t c C s | r+ | } t j | t j t j B } n t j d d \ } } z t j | d | t j | t j | d t j | d d g d t j d t j d t j } | j d } | j | j d d | s | j d | k | n | j d | k | Wd t j | X| S( s Create a test crash.t dirs /var/tmps #!/usr/bin/python import apport_python_hook apport_python_hook.install() def func(x): raise Exception(b'This should happen. \xe2\x99\xa5'.decode('UTF-8')) %s func(42) i t testarg1t testarg2t stdoutt stderrt envi s4 crashing test python program exits with failure codes This should happen.t OSErrorN( R t opent O_CREATt O_WRONLYt tempfilet mkstempt writet closet chmodt subprocesst Popent PIPEt environt communicatet assertEqualt returncodet assertTruet assertFalseR ( R t extracodet scriptnamet scriptt fdt pt err( ( s2 /usr/share/apport/testsuite/test_python_crashes.pyt _test_crash s&