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
# 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)