Projet

Général

Profil

0007-misc-pylint-fix-useless-object-inheritance-52630.patch

Lauréline Guérin, 02 avril 2021 17:21

Télécharger (6,53 ko)

Voir les différences:

Subject: [PATCH 07/18] misc: pylint fix useless-object-inheritance (#52630)

 tests/backoffice_pages/test_all.py |  2 +-
 tests/test_datasource.py           | 16 ++++++++--------
 tests/test_templates.py            |  4 ++--
 tests/test_widgets.py              |  2 +-
 tests/utilities.py                 | 12 ++++++------
 5 files changed, 18 insertions(+), 18 deletions(-)
tests/backoffice_pages/test_all.py
4355 4355
    assert 'Criticality Level: red' in resp.text
4356 4356

  
4357 4357

  
4358
class IHateUnicode(object):
4358
class IHateUnicode:
4359 4359
    def __unicode__(self):
4360 4360
        raise Exception('HATE!!')
4361 4361

  
tests/test_datasource.py
259 259
    # json specified with a variadic url
260 260
    get_request().datasources_cache = {}
261 261

  
262
    class JsonUrlPath(object):
262
    class JsonUrlPath:
263 263
        def get_substitution_variables(self):
264 264
            return {'json_url': 'file://%s' % json_file_path}
265 265

  
......
273 273
    # same with django templated url
274 274
    get_request().datasources_cache = {}
275 275

  
276
    class JsonUrlPath(object):
276
    class JsonUrlPath:
277 277
        def get_substitution_variables(self):
278 278
            return {'json_url': 'file://%s' % json_file_path}
279 279

  
......
287 287
    # json specified with a variadic url with an erroneous space
288 288
    get_request().datasources_cache = {}
289 289

  
290
    class JsonUrlPath(object):
290
    class JsonUrlPath:
291 291
        def get_substitution_variables(self):
292 292
            return {'json_url': 'file://%s' % json_file_path}
293 293

  
......
301 301
    # same with django templated url
302 302
    get_request().datasources_cache = {}
303 303

  
304
    class JsonUrlPath(object):
304
    class JsonUrlPath:
305 305
        def get_substitution_variables(self):
306 306
            return {'json_url': 'file://%s' % json_file_path}
307 307

  
......
606 606
    # geojson specified with a variadic url
607 607
    get_request().datasources_cache = {}
608 608

  
609
    class GeoJSONUrlPath(object):
609
    class GeoJSONUrlPath:
610 610
        def get_substitution_variables(self):
611 611
            return {'geojson_url': 'file://%s' % geojson_file_path}
612 612

  
......
630 630
    # same with django templated url
631 631
    get_request().datasources_cache = {}
632 632

  
633
    class GeoJSONUrlPath(object):
633
    class GeoJSONUrlPath:
634 634
        def get_substitution_variables(self):
635 635
            return {'geojson_url': 'file://%s' % geojson_file_path}
636 636

  
......
654 654
    # geojson specified with a variadic url with an erroneous space
655 655
    get_request().datasources_cache = {}
656 656

  
657
    class GeoJSONUrlPath(object):
657
    class GeoJSONUrlPath:
658 658
        def get_substitution_variables(self):
659 659
            return {'geojson_url': 'file://%s' % geojson_file_path}
660 660

  
......
678 678
    # same with django templated url
679 679
    get_request().datasources_cache = {}
680 680

  
681
    class GeoJSONUrlPath(object):
681
    class GeoJSONUrlPath:
682 682
        def get_substitution_variables(self):
683 683
            return {'geojson_url': 'file://%s' % geojson_file_path}
684 684

  
tests/test_templates.py
624 624
    assert t.render({'c1': {'lat': '48', 'lon': '2'}, 'c2': {'lat': '48.1', 'lng': '2.1'}}) == '13387.2'
625 625
    assert t.render({'c1': {'lat': '48', 'lng': '2'}, 'c2': {'lat': '48.1', 'lng': '2.1'}}) == '13387.2'
626 626

  
627
    class MockFormData(object):
627
    class MockFormData:
628 628
        formdef = None
629 629
        geolocations = {'base': {'lat': 48, 'lon': 2}}
630 630

  
......
692 692

  
693 693

  
694 694
def test_reproj():
695
    class MockFormData(object):
695
    class MockFormData:
696 696
        formdef = None
697 697
        geolocations = {'base': {'lat': 48, 'lon': 2}}
698 698

  
tests/test_widgets.py
52 52
    shutil.rmtree(pub.APP_DIR)
53 53

  
54 54

  
55
class MockHtmlForm(object):
55
class MockHtmlForm:
56 56
    def __init__(self, widget):
57 57
        widget = copy.deepcopy(widget)
58 58
        form = Form(method='post', use_tokens=False, enctype='application/x-www-form-urlencoded')
tests/utilities.py
33 33
wcs.middleware.AfterJobsMiddleware.ASYNC = False
34 34

  
35 35

  
36
class KnownElements(object):
36
class KnownElements:
37 37
    pickle_app_dir = None
38 38
    sql_app_dir = None
39 39
    sql_db_name = None
......
247 247
    return app
248 248

  
249 249

  
250
class EmailsMocking(object):
250
class EmailsMocking:
251 251
    def create_smtp_server(self, *args, **kwargs):
252
        class MockSmtplibSMTP(object):
252
        class MockSmtplibSMTP:
253 253
            def __init__(self, mocking):
254 254
                self.mocking = mocking
255 255

  
......
308 308
        sys.modules['wcs.qommon.emails'].create_smtp_server = self.wcs_create_smtp_server
309 309

  
310 310

  
311
class MockSubstitutionVariables(object):
311
class MockSubstitutionVariables:
312 312
    def get_substitution_variables(self):
313 313
        return {'bar': 'Foobar', 'foo': '1 < 3', 'email': 'sub@localhost', 'empty': ''}
314 314

  
315 315

  
316
class HttpRequestsMocking(object):
316
class HttpRequestsMocking:
317 317
    def __init__(self):
318 318
        self.requests = []
319 319

  
......
409 409

  
410 410
        data = force_bytes(data)
411 411

  
412
        class FakeResponse(object):
412
        class FakeResponse:
413 413
            def __init__(self, status, data, headers):
414 414
                self.status_code = status
415 415
                self.reason = 'whatever'
416
-