Tryag File Manager
Home
-
Turbo Force
Current Path :
/
usr
/
lib
/
python2.4
/
test
/
Upload File :
New :
File
Dir
//usr/lib/python2.4/test/mapping_tests.pyc
mò ‚=5Dc @ s[ d k Z d k Z d e i f d „ ƒ YZ d e f d „ ƒ YZ d e f d „ ƒ YZ d S( Nt BasicTestMappingProtocolc B s° t 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 d „ Z d „ Z d „ Z d „ Z d „ Z d „ Z RS( Nc C s h d d <d d <d d <S( s^ Return a dictionary of values which are invariant by storage in the object under test.i i t key1t value1t key2i N( i i i ( ( t self( ( t( /usr/lib/python2.4/test/mapping_tests.pyt _reference s c C s | i ƒ S( s Return an empty mapping objectN( R t type2test( R ( ( R t _empty_mapping s c C s7 | i ƒ } x$ | i ƒ D] \ } } | | | <q W| S( sK Return a mapping object with the value contained in data dictionaryN( R R t xt datat itemst keyt value( R R R R R ( ( R t _full_mapping s c O sŠ t i i | | | Ž | i ƒ i ƒ | _ | i i ƒ \ } } h | | <| _ | i i ƒ \ } } h | | <| _ | | i | <d S( N( t unittestt TestCaset __init__R t argst kwR t copyt referencet popitemR R t othert inmapping( R R R R R ( ( R R s c s ˆ i ƒ } t | ƒ } ˆ i ˆ i ƒ ‰ ˆ | j o | } n x1 ˆ i i ƒ D] \ } } ˆ i ˆ | | ƒ qQ Wˆ i i ƒ d ‰ ˆ i t ‡ ‡ d † ƒ ˆ i t | ƒ d ƒ ˆ i t ˆ ƒ t ˆ i ƒ ƒ x: ˆ i D]/ } ˆ i ˆ i | ƒ ƒ ˆ i | ˆ j ƒ qà Wx: ˆ i D]/ } ˆ i ˆ i | ƒ ƒ ˆ i | ˆ j ƒ qWˆ i t | | ƒ d ƒ ˆ i t ˆ ˆ ƒ d ƒ ˆ i t | ˆ ƒ d ƒ ˆ i t ˆ | ƒ d ƒ | o ˆ i d ƒ n ˆ p ˆ i d ƒ n ‡ d † } | ˆ i ƒ ˆ i ƒ ˆ i i ƒ ƒ | t ˆ ƒ ˆ i ƒ ˆ i i ƒ ƒ | ˆ i ƒ ˆ i ƒ ˆ i i ƒ ƒ | ˆ i ƒ ˆ i ƒ ˆ i i ƒ ƒ ˆ i ƒ i ƒ \ } } ˆ i i ƒ i ƒ \ ‰ } ˆ i ˆ i | | ƒ | ƒ ˆ i ˆ i ˆ | ƒ | ƒ ˆ i ˆ ˆ j ƒ d S( Ni c s ˆ ˆ S( N( t dt knownkey( ( R R ( R t <lambda>5 s iÿÿÿÿi s# Empty mapping must compare to Falses! Full mapping must compare to Truec sr ˆ i t | d ƒ ƒ ˆ i t | d ƒ ƒ t | ƒ } ˆ i t | ƒ t | ƒ j o t | ƒ j n ƒ d S( Nt nextt __iter__( R t assert_t hasattrt itert listR t sett lstt ref( R R# R$ R ( R ( R t check_iterandlistI s (! R R t pt dictt p1R R R R R R t assertEqualR t keysR t failUnlessRaisest KeyErrort lent kR t has_keyt failIft cmpt failR% t iterkeysR t itervaluest valuest iteritemsR t knownvaluet get( R R R( R R% R R7 R&