]> 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)
committerThierry Carrez <thierry@openstack.org>
Thu, 9 Oct 2014 07:14:37 +0000 (09:14 +0200)
This patch fixes the issue of mock not getting
cleaned for requests in unit tests.

Closes-Bug: #1353506

Change-Id: Iab401021d7f180ff1f2bf3ed79166699112cc367
(cherry picked from commit 140956515327494a53de6ad09c35690624248f0a)

cinder/tests/test_netapp_eseries_iscsi.py

index 7b1784514fe90e09a97ebc3a2f95153de62d5f0d..5d2b983494bf7d6b6e7ba131eb1c75fc095607fa 100644 (file)
@@ -640,7 +640,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()