#NEWLINE# def test_write( self ) : #NEWLINE# #INDENT# buf = self . buftype ( 'hello world\n' ) #NEWLINE# memio = self . ioclass ( buf ) #NEWLINE# self . write_ops ( memio , self . buftype ) #NEWLINE# self . assertEqual ( memio . getvalue ( ) , buf ) #NEWLINE# memio = self . ioclass ( ) #NEWLINE# self . write_ops ( memio , self . buftype ) #NEWLINE# self . assertEqual ( memio . getvalue ( ) , self ) #NEWLINE# self . assertRaises ( TypeError , memio . write , None ) #NEWLINE# memio . close ( ) #NEWLINE# self . assertRaises ( ValueError , memio . write , self . buftype ( '' ) )