Projet

Général

Profil

0062-misc-fix-unneeded-not-pylint-error-62099.patch

Lauréline Guérin, 22 mars 2022 10:32

Télécharger (9,94 ko)

Voir les différences:

Subject: [PATCH 62/65] misc: fix unneeded-not pylint error (#62099)

 passerelle/apps/family/loaders/concerto_fondettes.py | 2 +-
 passerelle/apps/family/loaders/concerto_orleans.py   | 2 +-
 passerelle/apps/family/loaders/egee_thonon.py        | 2 +-
 passerelle/apps/sfr_dmc/models.py                    | 2 +-
 passerelle/contrib/solis_apa/models.py               | 2 +-
 passerelle/contrib/tcl/models.py                     | 2 +-
 passerelle/contrib/toulouse_smart/models.py          | 2 +-
 passerelle/utils/jsonresponse.py                     | 2 +-
 tests/test_base_adresse.py                           | 2 +-
 tests/test_cmis.py                                   | 6 +++---
 tests/test_generic_endpoint.py                       | 2 +-
 tests/test_manager.py                                | 6 +++---
 tests/test_misc.py                                   | 4 ++--
 tests/test_sms.py                                    | 2 +-
 14 files changed, 19 insertions(+), 19 deletions(-)
passerelle/apps/family/loaders/concerto_fondettes.py
35 35
        self.connector = connector
36 36

  
37 37
    def clean(self, archive):
38
        if not 'data_full.csv' in archive.namelist():
38
        if 'data_full.csv' not in archive.namelist():
39 39
            raise ValidationError(_('Missing data_full.csv file in zip.'))
40 40

  
41 41
    def load(self, archive):
passerelle/apps/family/loaders/concerto_orleans.py
118 118
            'extract_prcit_enfant.csv',
119 119
            'extract_prcit_facture.csv',
120 120
        ):
121
            if not filename in archive.namelist():
121
            if filename not in archive.namelist():
122 122
                raise ValidationError(_('Missing %(filename)s file in zip.') % {'filename': filename})
123 123

  
124 124
    def csvread(self, filename):
passerelle/apps/family/loaders/egee_thonon.py
28 28
        self.connector = connector
29 29

  
30 30
    def clean(self, archive):
31
        if not 'factures.xml' in archive.namelist():
31
        if 'factures.xml' not in archive.namelist():
32 32
            raise ValidationError(_('Missing factures.xml file in zip.'))
33 33

  
34 34
    def load(self, archive):
passerelle/apps/sfr_dmc/models.py
293 293
        if 'success' not in json_data:
294 294
            raise APIError('Bad JSON response')
295 295
        if not json_data['success']:
296
            if not 'errorDetail' in json_data:
296
            if 'errorDetail' not in json_data:
297 297
                raise APIError('Bad JSON response')
298 298
            raise APIError(json_data['errorDetail'])
passerelle/contrib/solis_apa/models.py
182 182
                continue
183 183
            text = '%0.5d %s' % (attrs['stdr.commune.cp_lieu'], v['value'].strip())
184 184

  
185
            if query and not query in text.lower():
185
            if query and query not in text.lower():
186 186
                continue
187 187
            ret.append({'id': v['id'], 'text': text})
188 188
        return ret
passerelle/contrib/tcl/models.py
81 81
            stop['passings'].append(passing)
82 82
            # create dictionary key from both line number and direction
83 83
            line_info_key = passing['line_info']['ligne'] + '-' + passing['direction']
84
            if not line_info_key in passings_by_line:
84
            if line_info_key not in passings_by_line:
85 85
                passings_by_line[line_info_key] = []
86 86
            passings_by_line[line_info_key].append(passing)
87 87

  
passerelle/contrib/toulouse_smart/models.py
71 71
                    if prop.get('restrictedValues'):
72 72
                        prop['type'] = 'item'
73 73
                    if prop.get('type') in ('string', 'int', 'boolean', 'item'):
74
                        if not 'properties' in item:
74
                        if 'properties' not in item:
75 75
                            item['properties'] = []
76 76
                        item['properties'].append(prop)
77 77
                intervention_types.append(item)
passerelle/utils/jsonresponse.py
63 63
        return wrapper
64 64

  
65 65
    def obj_to_response(self, req, obj):
66
        if isinstance(obj, dict) and not 'err' in obj:
66
        if isinstance(obj, dict) and 'err' not in obj:
67 67
            obj['err'] = 0
68 68
        return obj
69 69

  
tests/test_base_adresse.py
734 734
        paris2 = cities.get(zipcode='75002')
735 735
        paris_json = paris.to_json()
736 736
        for key, value in paris2.to_json().items():
737
            if not key in ['id', 'text', 'zipcode']:
737
            if key not in ['id', 'text', 'zipcode']:
738 738
                assert paris_json[key] == value
739 739

  
740 740
        miquelon = cities.get(zipcode='97500')
tests/test_cmis.py
490 490

  
491 491
    resp = resp.click('Explore available object types')
492 492
    assert all(id in resp.text for id in root_types)
493
    assert not 'Back to' in resp.text
494
    assert not 'Children' in resp.text
495
    assert not 'Properties' in resp.text
493
    assert 'Back to' not in resp.text
494
    assert 'Children' not in resp.text
495
    assert 'Properties' not in resp.text
496 496

  
497 497
    resp = resp.click(root_type1.id)
498 498
    assert all(id in resp.text for id in root_type1.properties)
tests/test_generic_endpoint.py
316 316
        connector.foo6.endpoint_info.example_url_as_html()
317 317
        == '/fake/connector/foo6/<i class="varname">param1</i>/'
318 318
    )
319
    assert not '&reg' in connector.foo8.endpoint_info.example_url_as_html()
319
    assert '&reg' not in connector.foo8.endpoint_info.example_url_as_html()
320 320

  
321 321
    connector.foo6.endpoint_info.pattern = None
322 322
    connector.foo6.endpoint_info.example_pattern = None
tests/test_manager.py
430 430

  
431 431
    app = login(app)
432 432
    resp = app.get(csv.get_absolute_url())
433
    assert not 'jobs' in resp.text
433
    assert 'jobs' not in resp.text
434 434

  
435 435
    csv.add_job('sample_job')
436 436
    resp = app.get(csv.get_absolute_url())
......
683 683
    app = login(app)
684 684
    resp = app.get('/manage/', status=200)
685 685
    assert len(resp.pyquery('li.connector')) == 1
686
    assert not 'open access' in resp.text
686
    assert 'open access' not in resp.text
687 687

  
688 688
    obj_type = ContentType.objects.get_for_model(csv)
689 689
    AccessRight.objects.create(codename='can_access', apiuser=api, resource_type=obj_type, resource_pk=csv.pk)
690 690

  
691 691
    resp = app.get('/manage/', status=200)
692
    assert not 'open access' in resp.text
692
    assert 'open access' not in resp.text
693 693

  
694 694
    api.key = ''
695 695
    api.save()
tests/test_misc.py
32 32

  
33 33
def test_get_description_secret_fields(db):
34 34
    connector = ClicRdv(slug='plop', apikey='secret1', username='plop', password='secret2')
35
    assert not 'secret1' in [x[1] for x in connector.get_description_fields()]
36
    assert not 'secret2' in [x[1] for x in connector.get_description_fields()]
35
    assert 'secret1' not in [x[1] for x in connector.get_description_fields()]
36
    assert 'secret2' not in [x[1] for x in connector.get_description_fields()]
37 37

  
38 38

  
39 39
def test_log_cleaning(app, db, admin_user, settings):
tests/test_sms.py
216 216
    url = '/%s/%s/' % (connector.get_connector_slug(), connector.slug)
217 217
    resp = app.get(url)
218 218
    assert 'Endpoints' in resp.text
219
    assert not 'accessright/add' in resp.text
219
    assert 'accessright/add' not in resp.text
220 220
    app = login(app)
221 221
    resp = app.get(url)
222 222
    description_fields = [
223
-