Tests: Fix Pure test
The Pure driver's unit test test_get_thin_provisioning can break other
Cinder unit tests because it forcefully replaces the
volume_utils.get_max_over_subscription_ratio method with a Mock and
doesn't restore the original method afterwards.
This patch fixes this issue.
@@ -4117,7 +4117,7 @@ class PureVolumeUpdateStatsTestCase(PureBaseSharedDriverTestCase):
config_ratio,
expected_ratio,
auto):
- volume_utils.get_max_over_subscription_ratio = mock.Mock(
+ self.mock_object(volume_utils, 'get_max_over_subscription_ratio',
return_value=expected_ratio)
self.mock_config.pure_automatic_max_oversubscription_ratio = auto
self.mock_config.max_over_subscription_ratio = config_ratio
