From 628dadca00d6c10dc9d69b6550d37bec0e8fbdd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Fri, 18 Mar 2022 14:24:29 +0100
Subject: [PATCH 13/65] misc: fix useless-object-inheritance pylint error
 (#62099)

---
 passerelle/apps/atos_genesys/utils.py              |  2 +-
 passerelle/apps/base_adresse/models.py             |  2 +-
 passerelle/apps/cityweb/cityweb.py                 |  2 +-
 passerelle/apps/cmis/models.py                     |  2 +-
 .../apps/family/loaders/concerto_fondettes.py      |  2 +-
 passerelle/apps/family/loaders/concerto_orleans.py |  2 +-
 passerelle/apps/family/loaders/opus_fondettes.py   |  2 +-
 passerelle/apps/mdel/mdel.py                       |  4 ++--
 passerelle/apps/sp_fr/models.py                    |  2 +-
 passerelle/apps/sp_fr/views.py                     |  2 +-
 passerelle/apps/sp_fr/xsd.py                       |  4 ++--
 passerelle/base/__init__.py                        |  2 +-
 passerelle/base/forms.py                           |  2 +-
 passerelle/base/mixins.py                          |  2 +-
 passerelle/base/models.py                          |  2 +-
 passerelle/contrib/dpark/models.py                 |  2 +-
 passerelle/contrib/greco/formdata.py               |  2 +-
 passerelle/contrib/planitech/mste.py               |  4 ++--
 passerelle/contrib/utils/axel.py                   |  2 +-
 passerelle/utils/api.py                            |  2 +-
 passerelle/utils/jsonresponse.py                   |  2 +-
 passerelle/utils/sftp.py                           |  2 +-
 passerelle/utils/wcs.py                            | 14 +++++++-------
 passerelle/utils/xml.py                            |  2 +-
 passerelle/utils/zip.py                            |  4 ++--
 passerelle/views.py                                |  2 +-
 tests/test_astregs.py                              |  2 +-
 tests/test_atal.py                                 |  2 +-
 tests/test_atos_genesys.py                         |  2 +-
 tests/test_cmis.py                                 |  2 +-
 tests/test_dpark.py                                |  2 +-
 tests/test_generic_endpoint.py                     |  8 ++++----
 tests/test_iparapheur.py                           |  2 +-
 tests/test_mdph13.py                               |  2 +-
 tests/test_planitech.py                            |  2 +-
 tests/test_requests.py                             |  4 ++--
 tests/test_soap.py                                 |  2 +-
 37 files changed, 51 insertions(+), 51 deletions(-)

diff --git a/passerelle/apps/atos_genesys/utils.py b/passerelle/apps/atos_genesys/utils.py
index 893000bc..1cbf5f07 100644
--- a/passerelle/apps/atos_genesys/utils.py
+++ b/passerelle/apps/atos_genesys/utils.py
@@ -24,7 +24,7 @@ def row_lock(row):
         yield
 
 
-class RowLockedCache(object):
+class RowLockedCache:
     """Cache return value of a function, always return the cached value for
     performance but if the cache is stale update it asynchronously using
     a thread, prevent multiple update using row locks on database models and
diff --git a/passerelle/apps/base_adresse/models.py b/passerelle/apps/base_adresse/models.py
index fa51d0cf..46e3cab8 100644
--- a/passerelle/apps/base_adresse/models.py
+++ b/passerelle/apps/base_adresse/models.py
@@ -574,7 +574,7 @@ class BaseAdresse(AddressResource):
         self.update_api_geo_data()
 
 
-class UnaccentNameMixin(object):
+class UnaccentNameMixin:
     def save(self, *args, **kwargs):
         self.unaccent_name = simplify(self.name)
         super().save(*args, **kwargs)
diff --git a/passerelle/apps/cityweb/cityweb.py b/passerelle/apps/cityweb/cityweb.py
index 2fc88415..51c28011 100644
--- a/passerelle/apps/cityweb/cityweb.py
+++ b/passerelle/apps/cityweb/cityweb.py
@@ -64,7 +64,7 @@ def is_clean(element):
     return all(is_clean(child) for child in element.iterchildren())
 
 
-class BaseType(object):
+class BaseType:
     """Base data binding object"""
 
     tagname = None
diff --git a/passerelle/apps/cmis/models.py b/passerelle/apps/cmis/models.py
index 17975f46..565e5b17 100644
--- a/passerelle/apps/cmis/models.py
+++ b/passerelle/apps/cmis/models.py
@@ -184,7 +184,7 @@ def wrap_cmis_error(f):
     return wrapper
 
 
-class CMISGateway(object):
+class CMISGateway:
     def __init__(self, cmis_endpoint, username, password, logger):
         self._cmis_client = CmisClient(cmis_endpoint, username, password, passerelle_logger=logger)
         self._logger = logger
diff --git a/passerelle/apps/family/loaders/concerto_fondettes.py b/passerelle/apps/family/loaders/concerto_fondettes.py
index 6ba944c9..6fbb29e0 100644
--- a/passerelle/apps/family/loaders/concerto_fondettes.py
+++ b/passerelle/apps/family/loaders/concerto_fondettes.py
@@ -30,7 +30,7 @@ def u(s):
     return force_text(s, 'iso-8859-15')
 
 
-class Loader(object):
+class Loader:
     def __init__(self, connector):
         self.connector = connector
 
diff --git a/passerelle/apps/family/loaders/concerto_orleans.py b/passerelle/apps/family/loaders/concerto_orleans.py
index 046af2aa..2275cb32 100644
--- a/passerelle/apps/family/loaders/concerto_orleans.py
+++ b/passerelle/apps/family/loaders/concerto_orleans.py
@@ -107,7 +107,7 @@ class Dialect(csv.Dialect):
     skipinitialspace = False
 
 
-class Loader(object):
+class Loader:
     def __init__(self, connector):
         self.connector = connector
 
diff --git a/passerelle/apps/family/loaders/opus_fondettes.py b/passerelle/apps/family/loaders/opus_fondettes.py
index f89803c6..7ae78401 100644
--- a/passerelle/apps/family/loaders/opus_fondettes.py
+++ b/passerelle/apps/family/loaders/opus_fondettes.py
@@ -30,7 +30,7 @@ def u(s):
     return force_text(s, 'iso-8859-15')
 
 
-class Loader(object):
+class Loader:
     def __init__(self, connector):
         self.connector = connector
 
diff --git a/passerelle/apps/mdel/mdel.py b/passerelle/apps/mdel/mdel.py
index 82dc389a..0f15605d 100644
--- a/passerelle/apps/mdel/mdel.py
+++ b/passerelle/apps/mdel/mdel.py
@@ -32,7 +32,7 @@ def get_resource_base_dir():
     return default_storage.path('mdel')
 
 
-class AttachedFile(object):
+class AttachedFile:
     def __init__(self, code, filename, b64_content):
         if code not in ('JI', 'JD'):
             raise APIError('%s is not a valid code (JI or JD)' % code)
@@ -46,7 +46,7 @@ class AttachedFile(object):
         default_storage.save(path, ContentFile(self.content))
 
 
-class MDELBase(object):
+class MDELBase:
     def to_string(self):
         raw_string = etree.tostring(self.xml, encoding='utf-8')
         parsed_string = minidom.parseString(raw_string)
diff --git a/passerelle/apps/sp_fr/models.py b/passerelle/apps/sp_fr/models.py
index 083f5e2a..68f97887 100644
--- a/passerelle/apps/sp_fr/models.py
+++ b/passerelle/apps/sp_fr/models.py
@@ -187,7 +187,7 @@ class Resource(BaseResource):
                     if not count:
                         break
 
-    class FileHandler(object):
+    class FileHandler:
         def __init__(self, resource, sftp, filename, identifier, procedure, sequence, mapping):
             self.resource = resource
             self.sftp = sftp
diff --git a/passerelle/apps/sp_fr/views.py b/passerelle/apps/sp_fr/views.py
index dee72311..c4269ff7 100644
--- a/passerelle/apps/sp_fr/views.py
+++ b/passerelle/apps/sp_fr/views.py
@@ -23,7 +23,7 @@ from passerelle.base.mixins import ResourceChildViewMixin
 from . import forms, models
 
 
-class StayIfChanged(object):
+class StayIfChanged:
     has_changed = False
 
     def form_valid(self, form):
diff --git a/passerelle/apps/sp_fr/xsd.py b/passerelle/apps/sp_fr/xsd.py
index 481fd658..036c1384 100644
--- a/passerelle/apps/sp_fr/xsd.py
+++ b/passerelle/apps/sp_fr/xsd.py
@@ -66,7 +66,7 @@ TYPE_CASTER = {
 }
 
 
-class Schema(object):
+class Schema:
     def __init__(self):
         self.types = {}
         self.elements = {}
@@ -293,7 +293,7 @@ class Schema(object):
 
 
 @six.python_2_unicode_compatible
-class Path(object):
+class Path:
     def __init__(self, path, xsd_type):
         assert path
         self.path = path
diff --git a/passerelle/base/__init__.py b/passerelle/base/__init__.py
index 05ee0a91..831ed4e2 100644
--- a/passerelle/base/__init__.py
+++ b/passerelle/base/__init__.py
@@ -19,7 +19,7 @@ from django.apps import apps
 from django.utils.module_loading import import_string
 
 
-class ConnectorAppMixin(object):
+class ConnectorAppMixin:
     def get_connector_model(self):
         return self._connector_model
 
diff --git a/passerelle/base/forms.py b/passerelle/base/forms.py
index 0360eded..87d788dd 100644
--- a/passerelle/base/forms.py
+++ b/passerelle/base/forms.py
@@ -54,7 +54,7 @@ class ImportSiteForm(forms.Form):
     import_users = forms.BooleanField(label=_('Import users and access rights'), required=False)
 
 
-class BaseQueryFormMixin(object):
+class BaseQueryFormMixin:
     def clean_slug(self):
         slug = self.cleaned_data['slug']
 
diff --git a/passerelle/base/mixins.py b/passerelle/base/mixins.py
index 5c76eb14..cf62cc4e 100644
--- a/passerelle/base/mixins.py
+++ b/passerelle/base/mixins.py
@@ -17,7 +17,7 @@
 from django.utils import functional
 
 
-class ResourceChildViewMixin(object):
+class ResourceChildViewMixin:
     '''Mixin to help implementing view for child objects of resource objets.'''
 
     @property
diff --git a/passerelle/base/models.py b/passerelle/base/models.py
index d4b892b2..ae8cd4d8 100644
--- a/passerelle/base/models.py
+++ b/passerelle/base/models.py
@@ -906,7 +906,7 @@ class ResourceStatus(models.Model):
         return self.status == 'down'
 
 
-class ProxyLogger(object):
+class ProxyLogger:
     def __init__(self, connector, extra=None, transaction_id=None):
         self.connector = connector
         self.appname = connector.get_connector_slug()
diff --git a/passerelle/contrib/dpark/models.py b/passerelle/contrib/dpark/models.py
index 5770c97c..c604fb6f 100644
--- a/passerelle/contrib/dpark/models.py
+++ b/passerelle/contrib/dpark/models.py
@@ -36,7 +36,7 @@ from passerelle.utils.jsonresponse import APIError
 from passerelle.views import WrongParameter
 
 
-class Error(object):
+class Error:
     def __init__(self, code, msg=None):
         self.code = code
         self.msg = msg
diff --git a/passerelle/contrib/greco/formdata.py b/passerelle/contrib/greco/formdata.py
index a04f3af3..97b0ba69 100644
--- a/passerelle/contrib/greco/formdata.py
+++ b/passerelle/contrib/greco/formdata.py
@@ -87,7 +87,7 @@ def list_schema_fields(schema):
         yield fieldname[0] if isinstance(fieldname, tuple) else fieldname
 
 
-class FormData(object):
+class FormData:
     def __init__(self, formdata, schema):
         if not isinstance(formdata, dict):
             raise ValueError('formdata must be a dict')
diff --git a/passerelle/contrib/planitech/mste.py b/passerelle/contrib/planitech/mste.py
index 188f031d..f2a483a5 100644
--- a/passerelle/contrib/planitech/mste.py
+++ b/passerelle/contrib/planitech/mste.py
@@ -62,7 +62,7 @@ class Uint32(int):
     pass
 
 
-class MSTEDecoder(object):
+class MSTEDecoder:
     def __init__(self, data):
         self._idx = 4
         self._keys = []
@@ -171,7 +171,7 @@ class ObjectStore(list):
             return None
 
 
-class MSTEEncoder(object):
+class MSTEEncoder:
     def __init__(self, data):
         self._data = data
         self._stream = []
diff --git a/passerelle/contrib/utils/axel.py b/passerelle/contrib/utils/axel.py
index 71bcaf21..8d874635 100644
--- a/passerelle/contrib/utils/axel.py
+++ b/passerelle/contrib/utils/axel.py
@@ -196,7 +196,7 @@ def xml_schema_converter(axel_schema, base_xsd_path, name, root_element):
 OperationResult = namedtuple('OperationResult', ['json_response', 'xml_request', 'xml_response'])
 
 
-class Operation(object):
+class Operation:
     base_xsd_path = None
     default_prefix = ''
     axel_schema = AxelSchema
diff --git a/passerelle/utils/api.py b/passerelle/utils/api.py
index d4302511..5bce1170 100644
--- a/passerelle/utils/api.py
+++ b/passerelle/utils/api.py
@@ -26,7 +26,7 @@ from django.utils.safestring import mark_safe
 from .jsonresponse import APIError  # noqa pylint: disable=unused-import
 
 
-class endpoint(object):
+class endpoint:
     do_not_call_in_templates = True
 
     def __init__(
diff --git a/passerelle/utils/jsonresponse.py b/passerelle/utils/jsonresponse.py
index b3ccd7d9..8890ee07 100644
--- a/passerelle/utils/jsonresponse.py
+++ b/passerelle/utils/jsonresponse.py
@@ -45,7 +45,7 @@ class JSONEncoder(DjangoJSONEncoder):
         return super().default(o)
 
 
-class to_json(object):
+class to_json:
     def __init__(self, error_code=500, logger=None, **kwargs):
         self.error_code = error_code
         self.kwargs = kwargs
diff --git a/passerelle/utils/sftp.py b/passerelle/utils/sftp.py
index 0fb62c74..a6034e32 100644
--- a/passerelle/utils/sftp.py
+++ b/passerelle/utils/sftp.py
@@ -60,7 +60,7 @@ def _load_private_key(content_or_file, password=None):
 
 
 @six.python_2_unicode_compatible
-class SFTP(object):
+class SFTP:
     def __init__(self, url, private_key_content=None, private_key_password=None):
         self.url = url
         parsed = urlparse.urlparse(url)
diff --git a/passerelle/utils/wcs.py b/passerelle/utils/wcs.py
index efc67e1e..8ad2c670 100644
--- a/passerelle/utils/wcs.py
+++ b/passerelle/utils/wcs.py
@@ -40,7 +40,7 @@ class WcsApiError(Exception):
     pass
 
 
-class JSONFile(object):
+class JSONFile:
     def __init__(self, d):
         self.d = d
 
@@ -68,7 +68,7 @@ def to_dict(o):
         return o
 
 
-class BaseObject(object):
+class BaseObject:
     def __init__(self, wcs_api, **kwargs):
         self._wcs_api = wcs_api
         self.__dict__.update(**kwargs)
@@ -228,7 +228,7 @@ class Schema(BaseObject):
         self.geolocations = sorted((k, v) for k, v in (self.geolocations or {}).items())
 
 
-class FormDatas(object):
+class FormDatas:
     def __init__(self, wcs_api, formdef, full=False, anonymize=False, batch=1000):
         self.wcs_api = wcs_api
         self.formdef = formdef
@@ -307,7 +307,7 @@ class CancelSubmitError(Exception):
     pass
 
 
-class FormDefSubmit(object):
+class FormDefSubmit:
     formdef = None
     data = None
     user_email = None
@@ -498,7 +498,7 @@ class Category(BaseObject):
     pass
 
 
-class WcsObjects(object):
+class WcsObjects:
     url = None
     object_class = None
 
@@ -537,7 +537,7 @@ class Categories(WcsObjects):
     object_class = Category
 
 
-class WcsApi(object):
+class WcsApi:
     def __init__(
         self, url, email=None, name_id=None, batch_size=1000, session=None, logger=None, orig=None, key=None
     ):
@@ -643,7 +643,7 @@ def get_wcs_choices(session=None):
 
 
 @six.python_2_unicode_compatible
-class FormDefRef(object):
+class FormDefRef:
     _formdef = None
     _api = None
     session = None
diff --git a/passerelle/utils/xml.py b/passerelle/utils/xml.py
index 62e80c40..ed47e3ab 100644
--- a/passerelle/utils/xml.py
+++ b/passerelle/utils/xml.py
@@ -130,7 +130,7 @@ class TransformConverter(xmlschema.UnorderedConverter):
         return super().element_encode(obj, xsd_element, *args)
 
 
-class JSONSchemaFromXMLSchema(object):
+class JSONSchemaFromXMLSchema:
     SIMPLE_TYPE_MAPPING = {
         xmlschema_names.XSD_STRING: 'string',
         xmlschema_names.XSD_INTEGER: 'integer',
diff --git a/passerelle/utils/zip.py b/passerelle/utils/zip.py
index 91256ba9..0f03a314 100644
--- a/passerelle/utils/zip.py
+++ b/passerelle/utils/zip.py
@@ -93,7 +93,7 @@ VARIABLE_RE = re.compile(r'{{ *(\w*)')
 
 
 @python_2_unicode_compatible
-class ZipPart(object):
+class ZipPart:
     def __init__(self, zip_template, name_template, template_path=None, content_expression=None):
         self.zip_template = zip_template
         self._name_template = name_template
@@ -164,7 +164,7 @@ class ZipPart(object):
         return s.format(self)
 
 
-class ZipTemplate(object):
+class ZipTemplate:
     def __init__(self, manifest, ctx=None):
         if manifest.startswith('/'):
             path = manifest
diff --git a/passerelle/views.py b/passerelle/views.py
index 9031f46a..5bdfe9f6 100644
--- a/passerelle/views.py
+++ b/passerelle/views.py
@@ -149,7 +149,7 @@ class ManageAddView(TemplateView):
         return context
 
 
-class GenericConnectorMixin(object):
+class GenericConnectorMixin:
     exclude_fields = ('slug', 'users')
 
     def get_connector(self, **kwargs):
diff --git a/tests/test_astregs.py b/tests/test_astregs.py
index b2c3acf7..402bed7d 100644
--- a/tests/test_astregs.py
+++ b/tests/test_astregs.py
@@ -815,7 +815,7 @@ def test_context_overloading(mocked_serialize_object, connector, app, monkeypatc
     mock_operation_result = mock.Mock(liste=False, EncodeKeyContact=False)
     mock_operation = mock.Mock(return_value=mock_operation_result)
 
-    class MockService(object):
+    class MockService:
         def __getattr__(self, name):
             return mock_operation
 
diff --git a/tests/test_atal.py b/tests/test_atal.py
index 09fa1958..2178c4dc 100644
--- a/tests/test_atal.py
+++ b/tests/test_atal.py
@@ -40,7 +40,7 @@ def mock_atal_soap_call(monkeypatch, return_value=None, side_effect=None):
     return mock_soap_call
 
 
-class SoapElem(object):
+class SoapElem:
     def __init__(self, **kwargs):
         for attr, value in kwargs.items():
             setattr(self, attr, value)
diff --git a/tests/test_atos_genesys.py b/tests/test_atos_genesys.py
index ff6f3885..09342779 100644
--- a/tests/test_atos_genesys.py
+++ b/tests/test_atos_genesys.py
@@ -224,7 +224,7 @@ def test_row_locked_cache(genesys, freezer):
     freezer.move_to('2018-01-01 00:00:00')
     link = Link.objects.create(resource=genesys, name_id='zob', id_per='4567')
 
-    class F(object):
+    class F:
         calls = 0
         value = 1
 
diff --git a/tests/test_cmis.py b/tests/test_cmis.py
index bf9ba4dd..8802f73e 100644
--- a/tests/test_cmis.py
+++ b/tests/test_cmis.py
@@ -44,7 +44,7 @@ def setup(db):
 
 
 def test_uploadfile(app, setup, tmpdir, monkeypatch):
-    class FakeCMISGateway(object):
+    class FakeCMISGateway:
         def __init__(self, *args, **kwargs):
             pass
 
diff --git a/tests/test_dpark.py b/tests/test_dpark.py
index 078f558c..e06e32f0 100644
--- a/tests/test_dpark.py
+++ b/tests/test_dpark.py
@@ -82,7 +82,7 @@ class WebFaultHavingLatin1(WebFault):
     pass
 
 
-class MockedService(object):
+class MockedService:
     def __init__(self, success, error_class, replydata):
         self.success = success
         self.error_class = error_class
diff --git a/tests/test_generic_endpoint.py b/tests/test_generic_endpoint.py
index a4f01c25..9c3d7501 100644
--- a/tests/test_generic_endpoint.py
+++ b/tests/test_generic_endpoint.py
@@ -204,7 +204,7 @@ def test_proxy_logger_on_405(mocked_patch, caplog, app, arcgis):
         assert record.message == 'endpoint PATCH /arcgis/test/mapservice-query (=> 405)'
 
 
-class FakeConnectorBase(object):
+class FakeConnectorBase:
     slug = 'connector'
 
     def get_connector_slug(self):
@@ -348,7 +348,7 @@ def test_endpoint_decorator():
     assert connector.foo9.endpoint_info.long_description == 'foo9 post'
 
 
-class FakeJSONConnector(object):
+class FakeJSONConnector:
     slug = 'connector-json'
     log_level = 'DEBUG'
 
@@ -444,7 +444,7 @@ def test_endpoint_decorator_pre_process(db, app):
     assert resp.json['data'] == {'foo': [{'id': 42, 'bar': True}]}
 
 
-class FakeConnectorDatasource(object):
+class FakeConnectorDatasource:
     slug = 'connector-datasource'
     log_level = 'DEBUG'
 
@@ -627,7 +627,7 @@ def test_endpoint_cache(app, db, monkeypatch):
     connector = StubInvoicesConnector(slug='fake')
     connector.save()
 
-    class TestCache(object):
+    class TestCache:
         def __init__(self):
             self.d = dict()
             self.get_calls = 0
diff --git a/tests/test_iparapheur.py b/tests/test_iparapheur.py
index 793e3d02..46355a27 100644
--- a/tests/test_iparapheur.py
+++ b/tests/test_iparapheur.py
@@ -84,7 +84,7 @@ def test_call_ping(soap_client, app, conn):
     service = mock.Mock()
     service.echo.return_value = 'pong'
 
-    class MockedSettings(object):
+    class MockedSettings:
         def __init__(self, **kwargs):
             pass
 
diff --git a/tests/test_mdph13.py b/tests/test_mdph13.py
index 4157913f..626c7bc4 100644
--- a/tests/test_mdph13.py
+++ b/tests/test_mdph13.py
@@ -208,7 +208,7 @@ def mdph13(db):
 
 @pytest.fixture
 def mock_http():
-    class MockHttp(object):
+    class MockHttp:
         def __init__(self):
             self.requests = []
             self.responses = []
diff --git a/tests/test_planitech.py b/tests/test_planitech.py
index e28756e7..fcfc4585 100644
--- a/tests/test_planitech.py
+++ b/tests/test_planitech.py
@@ -245,7 +245,7 @@ def mock_planitech(monkeypatch, return_value=None, side_effect=None, referential
 
 
 def test_call_planitech(connector, monkeypatch):
-    class MockResponse(object):
+    class MockResponse:
 
         status_code = 200
         content = None
diff --git a/tests/test_requests.py b/tests/test_requests.py
index ae2f72e6..46ad360a 100644
--- a/tests/test_requests.py
+++ b/tests/test_requests.py
@@ -18,12 +18,12 @@ def clean_adapter_registry():
     Request.ADAPTER_REGISTRY.clear()
 
 
-class MockFileField(object):
+class MockFileField:
     def __init__(self, path):
         self.path = path
 
 
-class MockResource(object):
+class MockResource:
     logger = logging.getLogger('requests')
     basic_auth_username = ''
     basic_auth_password = ''
diff --git a/tests/test_soap.py b/tests/test_soap.py
index 43f4c349..35fc9472 100644
--- a/tests/test_soap.py
+++ b/tests/test_soap.py
@@ -34,7 +34,7 @@ class BarPlugin(Plugin):
     pass
 
 
-class SOAPResource(object):
+class SOAPResource:
     def __init__(self):
         self.requests = requests.Session()
         self.wsdl_url = WSDL
-- 
2.34.1

