<s> import sys <EOL> import unittest <EOL> sys . path . append ( '<STR_LIT>' ) <EOL> from unstdlib . standard . collections_ import RecentlyUsedContainer <EOL> from unstdlib . standard . exception_ import convert_exception <EOL> class TestRecentlyUsedContainer ( unittest . TestCase ) : <EOL> def test_maxsize ( self ) : <EOL> d = RecentlyUsedContainer ( <NUM_LIT:5> ) <EOL> for i in range ( <NUM_LIT:5> ) : <EOL> d [ i ] = str ( i ) <EOL> self . assertEqual ( len ( d ) , <NUM_LIT:5> ) <EOL> for i in range ( <NUM_LIT:5> ) : <EOL> self . assertEqual ( d [ i ] , str ( i ) ) <EOL> d [ i + <NUM_LIT:1> ] = str ( i + <NUM_LIT:1> ) <EOL> self . assertEqual ( len ( d ) , <NUM_LIT:5> ) <EOL> self . assertFalse ( <NUM_LIT:0> in d ) <EOL> self . assertTrue ( i + <NUM_LIT:1> in d ) <EOL> class TestException_ ( unittest . TestCase ) : <EOL> def test_convert_exception ( self ) : <EOL> class FooError ( Exception ) : <EOL> pass <EOL> class BarError ( Exception ) : <EOL> def __init__ ( self , message ) : <EOL> self . message = message <EOL> @ convert_exception ( FooError , BarError , message = '<STR_LIT:bar>' ) <EOL> def throw_foo ( ) : <EOL> raise FooError ( '<STR_LIT:foo>' ) <EOL> try : <EOL> throw_foo ( ) <EOL> except BarError as e : <EOL> self . assertEqual ( e . message , '<STR_LIT:bar>' ) <EOL> if __name__ == '<STR_LIT:__main__>' : <EOL> unittest . main ( ) </s>
