diff options
author | Ilya Tyaptin <ityaptin@mirantis.com> | 2015-07-10 19:18:04 +0300 |
---|---|---|
committer | Ilya Tyaptin <ityaptin@mirantis.com> | 2015-07-10 19:18:04 +0300 |
commit | 04ce0db3e7142fb855436900311eb8f6efc92daf (patch) | |
tree | 07040931b92fc8ebffd0d6a67109352088731ef6 | |
parent | 73842bba9977a6c9ea8ad99fa0e4c6653cdf7e6f (diff) | |
download | python-ceilometerclient-04ce0db3e7142fb855436900311eb8f6efc92daf.tar.gz |
Fix unit tests failing caused by new Mock release
Since the mock 1.1.1 calling of function 'assert_called' and
'assert_called_once' raises the AttributeError.
In current patchset calling of these functions is fixed
Change-Id: I5c21bb3f6cfd8cc095a277ead80794e97bb63c72
-rw-r--r-- | ceilometerclient/tests/unit/test_client.py | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/ceilometerclient/tests/unit/test_client.py b/ceilometerclient/tests/unit/test_client.py index 568af05..ffd47df 100644 --- a/ceilometerclient/tests/unit/test_client.py +++ b/ceilometerclient/tests/unit/test_client.py @@ -208,8 +208,11 @@ class ClientAuthTest(utils.BaseTestCase): client.auth_plugin.opts.pop('token', None) client.auth_plugin._do_authenticate(mock.MagicMock()) - discover_mock.assert_called(auth_url='http://no.where', - session=mock_session_instance) + self.assertEqual([mock.call(auth_url='http://no.where', + session=mock_session_instance)], + discover_mock.call_args_list) + # discover_mock.assert_called(auth_url='http://no.where', + # session=mock_session_instance) self.assertIsInstance(mock_session_instance.auth, v3_auth.Password) @mock.patch('keystoneclient.discover.Discover') @@ -233,9 +236,10 @@ class ClientAuthTest(utils.BaseTestCase): client = self.create_client(env) client.auth_plugin.opts.pop('token', None) client.auth_plugin._do_authenticate(mock.MagicMock()) + self.assertEqual([mock.call(auth_url='http://no.where', + session=session_instance_mock)], + discover.call_args_list) - discover.assert_called(auth_url='http://no.where', - session=session_instance_mock) self.assertIsInstance(session_instance_mock.auth, v2_auth.Password) @mock.patch('keystoneclient.discover.Discover') @@ -260,8 +264,9 @@ class ClientAuthTest(utils.BaseTestCase): self.assertRaises(ks_exc.DiscoveryFailure, client.auth_plugin._do_authenticate, mock.Mock()) - discover.assert_called(auth_url='http://no.where', - session=session_instance_mock) + self.assertEqual([mock.call(auth_url='http://no.where', + session=session_instance_mock)], + discover.call_args_list) @mock.patch('keystoneclient.discover.Discover') @mock.patch('keystoneclient.session.Session') |