]> review.fuel-infra Code Review - openstack-build/neutron-build.git/commitdiff
ML2 UT: Fix incorrect mock return value
authorRobert Pothier <rpothier@cisco.com>
Mon, 22 Dec 2014 16:42:35 +0000 (11:42 -0500)
committerRobert Pothier <rpothier@cisco.com>
Mon, 22 Dec 2014 16:42:35 +0000 (11:42 -0500)
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

index 26e813495c3f403ae70726d9babee19bd0c5beb0..e349a612e72330fd6130b4e5ae8500250d139636 100644 (file)
@@ -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)