ó
4Y~gc @ sr 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 e d k rn e j ƒ n d S( iÿÿÿÿNt
TestDiscoveryc B s} e Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z
d „ Z d
„ Z d „ Z
d „ Z RS(
c C se t j ƒ } d | _ | j d ƒ } | j | d ƒ t s> d S| j t ƒ | j d ƒ Wd QXd S( Ns /foos /foo/bar/baz.pys bar.bazs /bar/baz.py( t unittestt
TestLoadert _top_level_dirt _get_name_from_patht assertEqualt __debug__t assertRaisest AssertionError( t selft loadert name( ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyt test_get_name_from_path s c sˆ t j ƒ } t j ‰ ‡ f d † } t j j ‰ ‡ f d † } t j j ‰ ‡ f d † } d d d d d d d
g d d g g ‰ ‡ f d
† t _ | j | ƒ d „ } | t j _ | j | ƒ d „ } | t j _ | j | ƒ d „ | _ d „ | _ t j j
d ƒ } | | _ t | j
| d ƒ ƒ } g d D] } | d ^ q6}
|
j g d D] } d | d ^ qYƒ | j | |
ƒ d S( Nc s
ˆ t _ d S( N( t ost listdir( ( t original_listdir( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyt restore_listdir s c s ˆ t j _ d S( N( R
t patht isfile( ( t original_isfile( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyt restore_isfile! s c s ˆ t j _ d S( N( R
R t isdir( ( t original_isdir( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyt
restore_isdir$ s s test1.pys test2.pys
not_a_test.pyt test_dirs test.foos test-not-a-module.pyt another_dirs test3.pys test4.pyc s
ˆ j d ƒ S( Ni ( t pop( R ( t
path_lists( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyt * t c S s
| j d ƒ S( Nt dir( t endswith( R ( ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR - s c S s | j d ƒ o d | k S( NR R ( R ( R ( ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR 2 s c S s | d S( Ns module( ( R ( ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR 8 R c S s | d S( Ns tests( ( t module( ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR 9 R s /foos test*.pyt test1t test2s
module testst test3t test4s test_dir.%s( R! R" ( R# R$ ( R R R
R R R R t
addCleanupt _get_module_from_namet loadTestsFromModulet abspathR t listt _find_testst extendR ( R R
R R R R R t top_levelt suiteR t expected( ( R R R R sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyt test_find_tests s8
c s“ t j ƒ } t j ‰ ‡ f d † } t j j ‰ ‡ f d † } t j j ‰ ‡ f d † } d d d g ‰ ˆ g g g g ‰ ‡ f d † t _ ˆ j | ƒ d „ t j _ ˆ j | ƒ ‡ f d † t j _ ˆ j | ƒ d
t f d „ ƒ Y‰ ‡ f d † | _ ‡ f d
† } | | _
d | _ t | j
d d ƒ ƒ } ˆ j | d d d g ƒ ˆ j ˆ j d d g ƒ ˆ j ˆ j | d d d f g ƒ d S( Nc s
ˆ t _ d S( N( R
R ( ( R ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR I s c s ˆ t j _ d S( N( R
R R ( ( R ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR L s c s ˆ t j _ d S( N( R
R R ( ( R ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR O s t a_directoryt test_directoryt test_directory2c s
ˆ j d ƒ S( Ni ( R ( R ( R ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR T R c S s t S( N( t True( R ( ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR W R c s t j j | ƒ ˆ k S( N( R
R t basename( R ( t directories( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR Z R t Modulec B s, e Z g Z g Z d „ Z d „ Z d Z RS( c sP | ˆ _ ˆ j j | ƒ t j j | ƒ d k rL ‡ f d † } | ˆ _ n d S( NR1 c s ˆ j j | | | f ƒ d S( Nt
load_tests( t load_tests_argst append( R
t testst pattern( R ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyR7 e s ( R t pathsR9 R
R4 R7 ( R R R7 ( ( R sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyt __init__a s
c S s | j | j k S( N( R ( R t other( ( sA /opt/alt/python27/lib64/python2.7/unittest/test/test_discovery.pyt __eq__j s N( t __name__t
__module__R<