From 8e94aaa2b28b491314fe8642061ac73e3fe8e966 Mon Sep 17 00:00:00 2001 From: Navneet Singh Date: Thu, 28 Aug 2014 16:03:41 +0530 Subject: [PATCH] NetApp fix eseries unit test mock clean 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cinder/tests/test_netapp_eseries_iscsi.py b/cinder/tests/test_netapp_eseries_iscsi.py index 7b1784514..5d2b98349 100644 --- a/cinder/tests/test_netapp_eseries_iscsi.py +++ b/cinder/tests/test_netapp_eseries_iscsi.py @@ -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() -- 2.45.2