<s> from nose . tools import eq_ <EOL> from . . import ordered <EOL> def test_circle ( ) : <EOL> circle = ordered . Circle ( <NUM_LIT:3> ) <EOL> eq_ ( <NUM_LIT:0> , len ( circle ) ) <EOL> print ( circle . state ( ) ) <EOL> eq_ ( None , circle . append ( <NUM_LIT:5> ) ) <EOL> eq_ ( <NUM_LIT:1> , len ( circle ) ) <EOL> print ( circle . state ( ) ) <EOL> eq_ ( None , circle . append ( <NUM_LIT:6> ) ) <EOL> eq_ ( <NUM_LIT:2> , len ( circle ) ) <EOL> print ( circle . state ( ) ) <EOL> eq_ ( None , circle . append ( <NUM_LIT:7> ) ) <EOL> eq_ ( <NUM_LIT:3> , len ( circle ) ) <EOL> print ( circle . state ( ) ) <EOL> eq_ ( <NUM_LIT:5> , circle . append ( <NUM_LIT:8> ) ) <EOL> eq_ ( <NUM_LIT:3> , len ( circle ) ) <EOL> print ( circle . state ( ) ) <EOL> eq_ ( [ <NUM_LIT:6> , <NUM_LIT:7> , <NUM_LIT:8> ] , list ( circle ) ) <EOL> print ( circle . state ( ) ) <EOL> eq_ ( [ <NUM_LIT:8> , <NUM_LIT:7> , <NUM_LIT:6> ] , list ( reversed ( circle ) ) ) <EOL> def test_historical_map ( ) : <EOL> hist = ordered . HistoricalMap ( maxlen = <NUM_LIT:2> ) <EOL> assert "<STR_LIT:foo>" not in hist <EOL> eq_ ( None , hist . insert ( '<STR_LIT:foo>' , "<STR_LIT>" ) ) <EOL> assert "<STR_LIT:foo>" in hist <EOL> eq_ ( None , hist . insert ( '<STR_LIT:foo>' , "<STR_LIT>" ) ) <EOL> eq_ ( ( '<STR_LIT:foo>' , "<STR_LIT>" ) , hist . insert ( '<STR_LIT>' , "<STR_LIT>" ) ) </s>
