def test_restart_services_calls_infoblox_function(self): connector = mock.Mock() connector.get_object.return_value = mock.MagicMock() ibom = om.InfobloxObjectManager(connector) member = objects.Member(connector, name='member1', ip='some-ip') ibom.restart_all_services(member) connector.call_func.assert_called_once_with( 'restartservices', mock.ANY, mock.ANY)
def test_get_member_gets_member_object(self): connector = mock.Mock() connector.get_object.return_value = None ibom = om.InfobloxObjectManager(connector) member = objects.Member(connector, name='member1', ip='some-ip') ibom.get_member(member) matcher = PayloadMatcher({'host_name': member.name}) connector.get_object.assert_called_once_with('member', matcher, return_fields=mock.ANY)