#NEWLINE# def test_open( self ) : #NEWLINE# #INDENT# path = self . get_test_path ( 'test_open.txt' ) #NEWLINE# with self . cleaning ( path ) : #NEWLINE# #INDENT# assert_raises ( IOError , self . fs . open , path ) #NEWLINE# key = self . get_key ( path ) #NEWLINE# key . set_contents_from_string ( 'Hello' ) #NEWLINE# fh1 = self . fs . open ( path ) #NEWLINE# eq_ ( 'He' , fh1 . read ( length = 2 ) ) #NEWLINE# fh2 = self . fs . open ( path , mode = 'r' ) #NEWLINE# eq_ ( 'Hello' , fh2 . read ( ) ) #NEWLINE# eq_ ( 'llo' , fh1 . read ( ) ) #NEWLINE# assert_raises ( Exception , self . fs . open , path , mode = 'w' ) #NEWLINE# assert_raises ( Exception , self . fs . open , key , mode = '?r' )