File manager - Edit - /opt/imh-python/lib/python2.7/test/test_site.pyc
Back
� ��Wc @ s� d Z d d l Z d d l m Z m Z m Z 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 m Z d e j k r� d d l Z n e j d � � e j rGe j j e j � rGy$ e j e j � e j e j � WqGe k rCZ e j d e j e f � � qGXn d e j f d � � YZ d e f d � � YZ d e j f d � � YZ d � Z e d k r�e � n d S( s Tests for 'site'. Tests assume the initial paths in sys.path once the interpreter has begun executing have not been removed. i����N( t run_unittestt TESTFNt EnvironmentVarGuard( t captured_output( t copyt sites! importation of site.py suppresseds- unable to create user site directory (%r): %st HelperFunctionsTestsc B s� e Z d Z d � Z d � Z d � Z d � Z d � Z d � Z d e d � Z d � Z d � Z e j e j d k d � d � � Z d � Z e j e j d � d � � Z d � Z d � Z d � Z RS( s� Tests for helper functions. The setting of the encoding (set using sys.setdefaultencoding) used by the Unicode implementation is not tested. c C sG t j | _ t j | _ t j | _ t j | _ t t j � | _ d S( s Save a copy of sys.pathN( t syst patht sys_pathR t USER_BASEt old_baset USER_SITEt old_sitet PREFIXESt old_prefixesR t sysconfigt _CONFIG_VARSt old_vars( t self( ( sg /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_site.pyt setUp- s c C sA | j t j (| j t _ | j t _ | j t _ | j t _ d S( s Restore sys.pathN( R R R R R R R R R R R R R ( R ( ( sg /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_site.pyt tearDown5 s c C s� d } t j j | � } t j | � \ } } | j t j j | � | � | t j j | � k rt | j | | � n | j t j j | � | � d S( Nt Beginningt End( R R ( t osR t joinR t makepatht assertEqualt abspatht normcase( R t path_partst original_dirt abs_dirt norm_dir( ( sg /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_site.pyt test_makepath= s c C sy t j � } xf g t j D]1 } | r t j j | � r t j | � d ^ q D]# } | j | | d | | f � qN Wd S( Ni sB %s from sys.path not found in set returned by _init_pathinfo(): %s( R t _init_pathinfoR R R t isdirR t assertIn( R t dir_setR t entry( ( sg /builddir/build/BUILDROOT/imh-python-2.7.12-1.el7.x86_64/opt/imh-python/lib/python2.7/test/test_site.pyt test_init_pathinfoJ s 5c C sc | j | j t j d | j � | j t j | j � d t j � | j t j j | j � � d S( s>