Projet

Général

Profil

0020-misc-fix-misplaced-comparison-constant-pylint-error-.patch

Lauréline Guérin, 12 juillet 2021 11:24

Télécharger (3,05 ko)

Voir les différences:

Subject: [PATCH 20/23] misc: fix misplaced-comparison-constant pylint error
 (#55505)

 tests/api/test_datetimes.py                   | 4 ++--
 tests/manager/test_unavailability_calendar.py | 2 +-
 tests/test_agendas.py                         | 2 +-
 tests/test_interval.py                        | 3 ++-
 4 files changed, 6 insertions(+), 5 deletions(-)
tests/api/test_datetimes.py
102 102
        agenda=agenda,
103 103
    )
104 104
    resp = app.get('/api/agenda/%s/datetimes/' % agenda.slug)
105
    assert 'Hello world' == resp.json['data'][0]['text']
106
    assert 'Hello world' == resp.json['data'][0]['label']
105
    assert resp.json['data'][0]['text'] == 'Hello world'
106
    assert resp.json['data'][0]['label'] == 'Hello world'
107 107

  
108 108
    agenda.event_display_template = '{{ event.label }} - {{ event.start_datetime }}'
109 109
    agenda.save()
tests/manager/test_unavailability_calendar.py
191 191
    resp = resp.form.submit().follow()
192 192
    assert 'Exception foo' in resp.text
193 193
    time_period_exception.refresh_from_db()
194
    assert 'Exception foo' == time_period_exception.label
194
    assert time_period_exception.label == 'Exception foo'
195 195

  
196 196
    # with an error
197 197
    resp = app.get('/manage/time-period-exceptions/%s/edit' % time_period_exception.pk)
tests/test_agendas.py
513 513
    source = desk.timeperiodexceptionsource_set.create(ics_filename='sample.ics', ics_file=ics_sample)
514 514
    with pytest.raises(ICSError) as e:
515 515
        source._check_ics_content()
516
    assert 'Event "Événement 1" has no start date.' == str(e.value)
516
    assert str(e.value) == 'Event "Événement 1" has no start date.'
517 517

  
518 518

  
519 519
def test_timeperiodexception_creation_from_ics_without_enddt():
tests/test_interval.py
84 84
    assert IntervalSet([(1, 2)]) == [(1, 2)]
85 85
    assert [(1, 2)] == IntervalSet([(1, 2)])
86 86
    assert not IntervalSet([(1, 2)]) == None  # noqa pylint: disable=singleton-comparison
87
    assert not None == IntervalSet([(1, 2)])  # noqa pylint: disable=singleton-comparison
87
    # noqa pylint: disable=singleton-comparison,misplaced-comparison-constant
88
    assert not None == IntervalSet([(1, 2)])
88
-