From 48681af86a1dfd50a8e90a9d7cd9068417cc52a9 Mon Sep 17 00:00:00 2001 From: Tang Chen Date: Fri, 19 Feb 2016 13:44:54 +0800 Subject: [PATCH] Don't use Mock.called_once_with that does not exist Class mock.Mock does not exist method "called_once_with()", it just exists method "assert_called_once_with()". "called_once_with()" does nothing because it's a mock object. In OSC, only one place is still using "called_once_with()". Fix it. Change-Id: Ib890e95d775c3fc43df80fa05c82d726e78cdac8 Partial Bug: 1544522 --- openstackclient/tests/common/test_commandmanager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/openstackclient/tests/common/test_commandmanager.py b/openstackclient/tests/common/test_commandmanager.py index 056b637d2e..37dc90feb6 100644 --- a/openstackclient/tests/common/test_commandmanager.py +++ b/openstackclient/tests/common/test_commandmanager.py @@ -100,6 +100,6 @@ class TestCommandManager(utils.TestCase): mock_pkg_resources, ) as iter_entry_points: mgr = commandmanager.CommandManager('test') - assert iter_entry_points.called_once_with('test') + iter_entry_points.assert_called_once_with('test') cmds = mgr.get_command_names('test') self.assertEqual(['one', 'cmd two'], cmds)