From c948e4318665492cd9a46bfc9ec47250b8cc9692 Mon Sep 17 00:00:00 2001 From: Robert Pothier Date: Mon, 22 Dec 2014 11:42:35 -0500 Subject: [PATCH] ML2 UT: Fix incorrect mock return value In the UT for ML2 Cisco Nexus MD, in the function test_ncclient_version_detect() The value being passed into the mock is incorrect to mock the ncclient connect object. Change-Id: Ife1fc2a8f8fe284605ad77cee4ffa307e6d5360c Closes-Bug: #1404927 --- neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py b/neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py index 26e813495..e349a612e 100644 --- a/neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py +++ b/neutron/tests/unit/ml2/drivers/cisco/nexus/test_cisco_mech.py @@ -465,9 +465,9 @@ class TestCiscoPortsV2(CiscoML2MechanismTestCase, # The code we are exercising calls connect() twice, if there is a # TypeError on the first call (if the old ncclient is installed). # The second call should succeed. That's what we are simulating here. - connect = self.mock_ncclient.connect + orig_connect_return_val = self.mock_ncclient.connect.return_value with self._patch_ncclient('connect.side_effect', - [TypeError, connect]): + [TypeError, orig_connect_return_val]): with self._create_resources() as result: self.assertEqual(result.status_int, wexc.HTTPOk.code) -- 2.45.2