<s> import unittest <EOL> from tempfile import TemporaryFile as temp <EOL> from nose . tools import assert_equal <EOL> import multitail <EOL> class TestSeeking ( unittest . TestCase ) : <EOL> def test_basic ( self ) : <EOL> with temp ( ) as f : <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> f . write ( "<STR_LIT>" % i ) <EOL> for i in range ( <NUM_LIT:10> ) : <EOL> multitail . _seek_to_n_lines_from_end ( f , i ) <EOL> assert_equal ( i , len ( f . readlines ( ) ) ) <EOL> def test_short_file ( self ) : <EOL> """<STR_LIT>""" <EOL> with temp ( ) as f : <EOL> for i in range ( <NUM_LIT:3> ) : <EOL> f . write ( "<STR_LIT>" % i ) <EOL> multitail . _seek_to_n_lines_from_end ( f , <NUM_LIT:100> ) <EOL> assert_equal ( <NUM_LIT:3> , len ( f . readlines ( ) ) ) <EOL> def test_multiple_buffers ( self ) : <EOL> """<STR_LIT>""" <EOL> with temp ( ) as f : <EOL> for i in range ( <NUM_LIT> ) : <EOL> f . write ( "<STR_LIT>" % i ) <EOL> multitail . _seek_to_n_lines_from_end ( f , <NUM_LIT> ) <EOL> assert_equal ( <NUM_LIT> , len ( f . readlines ( ) ) ) </s>
