diff --git a/neutronclient/tests/unit/osc/v2/trunk/fakes.py b/neutronclient/tests/unit/osc/v2/trunk/fakes.py index 1acbcc3da..4ae1f287f 100644 --- a/neutronclient/tests/unit/osc/v2/trunk/fakes.py +++ b/neutronclient/tests/unit/osc/v2/trunk/fakes.py @@ -66,7 +66,7 @@ class FakeTrunk(object): @staticmethod def get_trunks(trunks=None, count=2): - """Get an iterable MagicMock object with a list of faked trunks. + """Get an iterable Mock object with a list of faked trunks. If trunks list is provided, then initialize the Mock object with the list. Otherwise create one. @@ -81,4 +81,4 @@ class FakeTrunk(object): """ if trunks is None: trunks = FakeTrunk.create_trunks(count) - return mock.MagicMock(side_effect=trunks) + return mock.Mock(side_effect=trunks) diff --git a/neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py b/neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py index d9658156b..c8ed19ac7 100644 --- a/neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py +++ b/neutronclient/tests/unit/osc/v2/trunk/test_network_trunk.py @@ -222,7 +222,7 @@ class TestDeleteNetworkTrunk(test_fakes.TestNeutronClientOSCV2): get_mock_result = [self._trunks[0], exceptions.CommandError] trunk._get_id = ( - mock.MagicMock(side_effect=get_mock_result) + mock.Mock(side_effect=get_mock_result) ) with testtools.ExpectedException(exceptions.CommandError) as e: self.cmd.take_action(parsed_args) @@ -522,7 +522,7 @@ class TestSetNetworkTrunk(test_fakes.TestNeutronClientOSCV2): parsed_args = self.check_parser(self.cmd, arglist, verifylist) self.neutronclient.update_trunk = ( - mock.MagicMock(side_effect=exceptions.CommandError) + mock.Mock(side_effect=exceptions.CommandError) ) with testtools.ExpectedException(exceptions.CommandError) as e: self.cmd.take_action(parsed_args) @@ -546,7 +546,7 @@ class TestSetNetworkTrunk(test_fakes.TestNeutronClientOSCV2): parsed_args = self.check_parser(self.cmd, arglist, verifylist) self.neutronclient.trunk_add_subports = ( - mock.MagicMock(side_effect=exceptions.CommandError) + mock.Mock(side_effect=exceptions.CommandError) ) with testtools.ExpectedException(exceptions.CommandError) as e: self.cmd.take_action(parsed_args) diff --git a/neutronclient/tests/unit/test_client_extension.py b/neutronclient/tests/unit/test_client_extension.py index 973f80068..60a208588 100644 --- a/neutronclient/tests/unit/test_client_extension.py +++ b/neutronclient/tests/unit/test_client_extension.py @@ -131,7 +131,7 @@ class CLITestV20ExtensionJSONAlternatePlurals(test_cli20.CLITestV20Base): def _mock_extension_loading(self): ext_pkg = 'neutronclient.common.extension' contrib = mock.patch(ext_pkg + '._discover_via_entry_points').start() - ip_address = mock.MagicMock() + ip_address = mock.Mock() ip_address.IPAddress = self.IPAddress ip_address.IPAddressesList = self.IPAddressesList contrib.return_value = [("ip_address", ip_address)] @@ -184,7 +184,7 @@ class CLITestV20ExtensionJSONChildResource(test_cli20.CLITestV20Base): def _mock_extension_loading(self): ext_pkg = 'neutronclient.common.extension' contrib = mock.patch(ext_pkg + '._discover_via_entry_points').start() - child = mock.MagicMock() + child = mock.Mock() child.Child = self.Child child.ChildrenList = self.ChildrenList child.ChildShow = self.ChildShow