Preserve mock side_effect’s in test_pure
Preserve mock side_effect’s in test_pure

The helper method to test if exceptions are propagated or handled would
unset the mock objects side_effect value when its done. This overrides
the original value making the mock not behave as expected as soon as it
is passed into assert_error_propagates.

This changes the helper to store the original side effect and then put
it back once we are done making it throw an exception.

Change-Id: I71900071a1c050913b7283aa743a17c24da1a6b9
Closes-Bug: #1474130
ge0rgi/cinder,potsmaster/cinder,takeshineshiro/cinder,Nexenta/cinder,tlakshman26/cinder-new-branch,nexusriot/cinder,dims/cinder,cloudbase/cinder,phenoxim/cinder,phenoxim/cinder,scality/cinder,tlakshman26/cinder-new-branch,eharney/cinder,apporc/cinder,tlakshman26/cinder-https-changes,Paul-Ezell/cinder-1,leilihh/cinder,cloudbase/cinder,scality/cinder,sasukeh/cinder,eharney/cinder,nikesh-mahalka/cinder,NetApp/cinder,tlakshman26/cinder-https-changes,JioCloud/cinder,winndows/cinder,potsmaster/cinder,manojhirway/ExistingImagesOnNFS,Datera/cinder,JioCloud/cinder,duhzecca/cinder,j-griffith/cinder,scottdangelo/RemoveVolumeMangerLocks,mahak/cinder,Hybrid-Cloud/cinder,openstack/cinder,takeshineshiro/cinder,tlakshman26/cinder-bug-fix-volume-conversion-full,CloudServer/cinder,NetApp/cinder,scottdangelo/RemoveVolumeMangerLocks,leilihh/cinder,openstack/cinder,bswartz/cinder,duhzecca/cinder,tlakshman26/cinder-bug-fix-volume-conversion-full,apporc/cinder,petrutlucian94/cinder,manojhirway/ExistingImagesOnNFS,Paul-Ezell/cinder-1,Nexenta/cinder,petrutlucian94/cinder,Hybrid-Cloud/cinder,bswartz/cinder,winndows/cinder,sasukeh/cinder,nikesh-mahalka/cinder,dims/cinder,mahak/cinder,CloudServer/cinder,j-griffith/cinder,nexusriot/cinder,Datera/cinder