#NEWLINE# @ mock . patch . multiple ( systemconfig , SCPreferencesCreate = mock . DEFAULT , SCPreferencesCommitChanges = mock . DEFAULT , SCPreferencesApplyChanges = mock . DEFAULT ) #NEWLINE# def testSaveApplyFailed( self , **mocks ) : #NEWLINE# #INDENT# 'Test SCPreferences Save, apply failed.' #NEWLINE# mocks [ 'SCPreferencesCreate' ] . return_value = 'session' #NEWLINE# mocks [ 'SCPreferencesCommitChanges' ] . return_value = True #NEWLINE# mocks [ 'SCPreferencesApplyChanges' ] . return_value = False #NEWLINE# scp = systemconfig . SCPreferences ( ) #NEWLINE# self . assertRaises ( systemconfig . SysconfigError , mocks . Save )