From: Robert Pothier Date: Mon, 22 Dec 2014 16:42:35 +0000 (-0500) Subject: ML2 UT: Fix incorrect mock return value X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c948e4318665492cd9a46bfc9ec47250b8cc9692;p=openstack-build%2Fneutron-build.git 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 --- 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)