]> review.fuel-infra Code Review - openstack-build/cinder-build.git/commitdiff
NetApp fix eseries unit test mock clean
authorNavneet Singh <singn@netapp.com>
Thu, 28 Aug 2014 10:33:41 +0000 (16:03 +0530)
committerNavneet Singh <singn@netapp.com>
Thu, 18 Sep 2014 17:27:04 +0000 (22:57 +0530)
This patch fixes the issue of mock not getting
cleaned for requests in unit tests.

Closes-Bug: #1353506

Change-Id: Iab401021d7f180ff1f2bf3ed79166699112cc367

cinder/tests/test_netapp_eseries_iscsi.py

index f345bb4021d3cd28c32c57725e22e17fd3e8f443..2f1c6abd59f19c12f092b76467b395e0b86fa08d 100644 (file)
@@ -614,7 +614,7 @@ class NetAppEseriesIscsiDriverTestCase(test.TestCase):
     def _custom_setup(self):
         configuration = self._set_config(create_configuration())
         self.driver = common.NetAppDriver(configuration=configuration)
-        requests.Session = mock.Mock(wraps=FakeEseriesHTTPSession)
+        self.mock_object(requests, 'Session', FakeEseriesHTTPSession)
         self.driver.do_setup(context='context')
         self.driver.check_for_setup_error()