<s> """<STR_LIT>""" <EOL> from operator import __getitem__ <EOL> def testIReadMapping ( self , inst , state , absent ) : <EOL> for key in state : <EOL> self . assertEqual ( inst [ key ] , state [ key ] ) <EOL> self . assertEqual ( inst . get ( key , None ) , state [ key ] ) <EOL> self . failUnless ( key in inst ) <EOL> for key in absent : <EOL> self . assertEqual ( inst . get ( key , None ) , None ) <EOL> self . assertEqual ( inst . get ( key ) , None ) <EOL> self . assertEqual ( inst . get ( key , self ) , self ) <EOL> self . assertRaises ( KeyError , __getitem__ , inst , key ) <EOL> def test_keys ( self , inst , state ) : <EOL> inst_keys = list ( inst . keys ( ) ) ; inst_keys . sort ( ) <EOL> state_keys = list ( state . keys ( ) ) ; state_keys . sort ( ) <EOL> self . assertEqual ( inst_keys , state_keys ) <EOL> def test_iter ( self , inst , state ) : <EOL> inst_keys = list ( inst ) ; inst_keys . sort ( ) <EOL> state_keys = list ( state . keys ( ) ) ; state_keys . sort ( ) <EOL> self . assertEqual ( inst_keys , state_keys ) <EOL> def test_values ( self , inst , state ) : <EOL> inst_values = list ( inst . values ( ) ) ; inst_values . sort ( ) <EOL> state_values = list ( state . values ( ) ) ; state_values . sort ( ) <EOL> self . assertEqual ( inst_values , state_values ) <EOL> def test_items ( self , inst , state ) : <EOL> inst_items = list ( inst . items ( ) ) ; inst_items . sort ( ) <EOL> state_items = list ( state . items ( ) ) ; state_items . sort ( ) <EOL> self . assertEqual ( inst_items , state_items ) <EOL> def test___len__ ( self , inst , state ) : <EOL> self . assertEqual ( len ( inst ) , len ( state ) ) <EOL> def testIEnumerableMapping ( self , inst , state ) : <EOL> test_keys ( self , inst , state ) <EOL> test_items ( self , inst , state ) <EOL> test_values ( self , inst , state ) <EOL> test___len__ ( self , inst , state ) <EOL> class BaseTestIReadMapping ( object ) : <EOL> def testIReadMapping ( self ) : <EOL> inst = self . _IReadMapping__sample ( ) <EOL> state = self . _IReadMapping__stateDict ( ) <EOL> absent = self . _IReadMapping__absentKeys ( ) <EOL> testIReadMapping ( self , inst , state , absent ) <EOL> class BaseTestIEnumerableMapping ( BaseTestIReadMapping ) : <EOL> def test_keys ( self ) : <EOL> inst = self . _IEnumerableMapping__sample ( ) <EOL> state = self . _IEnumerableMapping__stateDict ( ) <EOL> test_keys ( self , inst , state ) <EOL> def test_values ( self ) : <EOL> inst = self . _IEnumerableMapping__sample ( ) <EOL> state = self . _IEnumerableMapping__stateDict ( ) <EOL> test_values ( self , inst , state ) <EOL> def test_items ( self ) : <EOL> inst = self . _IEnumerableMapping__sample ( ) <EOL> state = self . _IEnumerableMapping__stateDict ( ) <EOL> test_items ( self , inst , state ) <EOL> def test___len__ ( self ) : <EOL> inst = self . _IEnumerableMapping__sample ( ) <EOL> state = self . _IEnumerableMapping__stateDict ( ) <EOL> test___len__ ( self , inst , state ) <EOL> def _IReadMapping__stateDict ( self ) : <EOL> return self . _IEnumerableMapping__stateDict ( ) <EOL> def _IReadMapping__sample ( self ) : <EOL> return self . _IEnumerableMapping__sample ( ) <EOL> def _IReadMapping__absentKeys ( self ) : <EOL> return self . _IEnumerableMapping__absentKeys ( ) </s>
