shell bypass 403
�
?��cc @ s� d d l m 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 d d l
Z
d e j f d � � YZ d e j f d � � YZ
d � Z e d k r� e � n d S( i����( t run_unittestNt PkgutilTestsc B s5 e Z d � Z d � Z d � Z d � Z d � Z RS( c C s? t j � | _ | j t j | j � t j j d | j � d S( Ni ( t tempfilet mkdtempt dirnamet
addCleanupt shutilt rmtreet syst patht insert( t self( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt setUp s c C s t j d =d S( Ni ( R R ( R ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt tearDown s c C s4 d } d } t j j | j | � } t j | � t t j j | d � d � } | j � t t j j | d � d � } | j | � | j � t j t j j | d � � t t j j | d d � d � } | j | � | j � t j | d � } | j
| | � t j | d � } | j
| | � t j | =d S( Nt test_getdata_filesyss% Hello, world!
Second line
Third lines __init__.pyt wbs res.txtt subs sub/res.txt(
t osR t joinR t mkdirt opent closet writet pkgutilt get_datat assertEqualR t modules( R t pkgt
RESOURCE_DATAt package_dirt ft res1t res2( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyR s$
!
c C s� d } d } d } t j j | j | � } t j | d � } | j | d d � | j | d | � | j | d | � | j � t j j d | � t
j | d
� } | j | | � t
j | d � } | j | | � t j d =t j
| =d S( Ns test_getdata_zipfile.zipt test_getdata_zipfiles% Hello, world!
Second line
Third linet ws /__init__.pyt s /res.txts /sub/res.txti s res.txts sub/res.txt( R R R R t zipfilet ZipFilet writestrR R R
R R R R ( R t zipR R t zip_filet zR R ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyR! 5 s
c C su d } t j j | j | � } t j | d � | j t j | � x- t j d | j g � D] } | j d � qZ Wd S( Nt unreadable_packagei R s unexpected package found(
R R R R R R t rmdirR t
walk_packagest fail( R t package_namet dt t( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt test_unreadable_dir_on_syspathQ s ( t __name__t
__module__R R
R R! R1 ( ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyR s
t PkgutilPEP302Testsc B sX e Z d e f d � � YZ d e f d � � YZ d � Z d � Z d � Z d � Z RS( t MyTestLoaderc B s e Z d � Z d � Z RS( c C sg t j j | t j | � � } d | j j | _ | | _ g | _ | j
j d d � d | j
d <| S( Ns <%s>t loadsi i ( R R t
setdefaultt impt
new_modulet __class__R2 t __file__t
__loader__t __path__t __dict__t get( R t fullnamet mod( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt load_module_ s c C s d S( Ns
Hello, world!( ( R R ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyR j s ( R2 R3 RB R ( ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyR5 ^ s t MyTestImporterc B s e Z d d � Z RS( c C s
t j � S( N( R4 R5 ( R R@ R ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt find_modulen s N( R2 R3 t NoneRD ( ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyRC m s c C s t j j d | j � � d S( Ni ( R t meta_pathR
RC ( R ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyR q s c C s t j d =d S( Ni ( R RF ( R ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyR
t s c C s* | j t j d d � d � t j d =d S( Nt foot dummys
Hello, world!( R R R R R ( R ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt test_getdata_pep302w s c C s\ d d l } | j | j d � | j t j d d � d � | j | j d � t j d =d S( Ni����i RG RH s
Hello, world!( RG R R6 R R R R ( R RG ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt test_alreadyloaded| s
( R2 R3 t objectR5 RC R R
RI RJ ( ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyR4 \ s c C s* t t t � d d l } | j j � d S( Ni����( R R R4 t zipimportt _zip_directory_cachet clear( RL ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt test_main� s
t __main__( t test.test_supportR t unittestR R8 R R t os.pathR R R$ t TestCaseR R4 RO R2 ( ( ( s8 /usr/local/python-2.7/lib/python2.7/test/test_pkgutil.pyt <module> s N*