#NEWLINE# def test_seq_read_write( self ) : #NEWLINE# #INDENT# b = VecBuf ( ) #NEWLINE# fl = flatten #NEWLINE# b . write_seq ( [ 'ab' , 'cd' , '' , 'ef' , 'gh' , 'ij' ] ) #NEWLINE# self . assertMatches ( b . read ( 0 ) , '' ) #NEWLINE# self . assertMatches ( b . read ( 1 ) , 'a' ) #NEWLINE# self . assertMatches ( b . read ( 2 ) , 'bc' ) #NEWLINE# self . assertMatches ( b . read ( 4 ) , 'defg' ) #NEWLINE# self . assertMatches ( b . read ( 0 ) , '' ) #NEWLINE# self . assertMatches ( b . read ( 2 ) , 'hi' ) #NEWLINE# self . assertRaises ( VecBufEOB , b . read , 2 ) #NEWLINE# self . assertMatches ( b . read ( 0 ) , '' ) #NEWLINE# self . assertMatches ( b . read ( 1 ) , 'j' ) #NEWLINE# self . assertRaises ( VecBufEOB , b . read , 1 ) #NEWLINE# b . write_seq ( [ '' , 'abcd' , 'efgh' , 'ijkl' , 'mnop' ] ) #NEWLINE# self . assertMatches ( b . read ( 2 ) , 'ab' ) #NEWLINE# self . assertMatches ( fl ( b . read_seq ( 8 ) ) , 'cdefghij' ) #NEWLINE# self . assertMatches ( b . read ( 4 ) , 'klmn' ) #NEWLINE# self . assertRaises ( VecBufEOB , b . read_seq , 3 ) #NEWLINE# self . assertMatches ( fl ( b . read_seq ( 2 ) ) , 'op' ) #NEWLINE# self . assertRaises ( VecBufEOB , b . read , 1 )