#NEWLINE# def test_save_raises( self ) : #NEWLINE# #INDENT# 'Test saving the state raises an error if it cannot save\n        ' #NEWLINE# state [ 'a' ] = 12 #NEWLINE# with tempfile . NamedTemporaryFile ( ) as temp : #NEWLINE# #INDENT# os . chmod ( temp . name , 0 ) #NEWLINE# self . assertRaises ( IOError , state . save , temp . name ) #NEWLINE# self . assertEqual ( os . stat ( self . name ) . st_size , 0 )